Drills tagged with this skill, unpassed first. Pass them all to mark the skill ready for scenarios.
sales_per_region(df) that returns a pandas Series indexed by region, where each value is the sum of the amount column for that region.
Example.
Input df:
| region | amount |
| ------ | ------ |
| North | 100 |
| South | 50 |
| North | 30 |
Returns a Series:
region
North 130
South 50
Notes.
- Region order in the result doesn't matter — we only compare keys → values.
- Empty DataFrame → return an empty Series.
- A region with only one order is still a valid group (its total is just that one value).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.avg_rating_per_genre(df) that returns a Series indexed by genre, with the mean of the rating column for that genre.
Example. Genre Action has ratings [4, 5] → entry Action: 4.5.
Notes. Genre order in the result doesn't matter. A genre with one rating returns that rating as its mean. Empty DataFrame → empty Series.