The brief
Toko Kita is a small Indonesian online shop that sells coffee, kitchen equipment, stationery, home goods and a few electronics. It's the start of July, and the first half of 2024 is over. Everyone wants to know how it went, and you're the one with pandas.
Three requests have landed on your desk. Management wants revenue per month and category in one table. Marketing wants to know who the customers are and how often they come back. And the warehouse has sent a stock count typed up by two different people in two different cities, which needs cleaning before anyone can decide what to reorder. Each task leans on a different part of the pandas track: grouping and pivoting, aggregation with named columns, and cleaning and merging.
How the tasks work
Each task is checked automatically, like the module questions. The tickets say what the result must contain, with exact names, but not which methods to use, and there's usually more than one good way. There are hints if you get stuck, but try each task without opening the solution first.
The tasks
| # | Task | Main skills |
|---|---|---|
| 1 | Monthly revenue report | Filtering, dates, pivot_table, idxmax |
| 2 | Customer summary | groupby with named aggregations, sorting, shares |
| 3 | A restock list from a messy count | String cleaning, drop_duplicates, merge |
The data
sales.csv is the order export from January to June 2024. Every row is one line of an order (one product), so an order with three products takes three rows that share an order_id. The columns are:
order_id, order_date, customer, city, segment, product, category, quantity, unit_price, revenue, channel, status
status is completed, shipped, pending or cancelled, and only completed rows count as sales in this review.
stock_count.csv is the warehouse count from the end of June, with the columns product, warehouse, counted_on, qty. Task 3 describes what's wrong with it.
When you're ready, open Task 1.