Counting duplicates
📖 Scenario: You work in a small bookstore. You have a list of books sold today, but some books appear more than once because multiple copies were sold. You want to find out how many times each book was sold.
🎯 Goal: Build a small program using pandas to count how many times each book title appears in the sales list.
📋 What You'll Learn
Create a pandas DataFrame with a column named
Book containing the exact book titles given.Create a variable called
count_duplicates that counts how many times each book title appears.Print the
count_duplicates variable to see the counts.💡 Why This Matters
🌍 Real World
Counting duplicates helps businesses understand which products sell more and manage inventory better.
💼 Career
Data analysts often count duplicates to summarize data and find popular items or repeated entries.
Progress0 / 4 steps