BuildlyBuildly
DashboardExercisesProfileHelp
Data Science/Module 2: Data Analytics/Group & Aggregate2/3
Exercise·7 min·10 XP

Orders per Customer

Context. An online store wants to know how many orders each customer placed.

Your task. Write orders_per_customer(df) that returns a Series indexed by customer_id with the count of orders per customer.

Example. Input rows (C1, O1), (C2, O2), (C1, O3) → Series {C1: 2, C2: 1}.

Notes. Order of customers in the result doesn't matter. Empty DataFrame → empty Series.

Previous
Sales per Region
Next
Average Rating per Genre