Case study: the March sales drop
From: Ravi Kumar, Sales Director
"Net revenue for March is down on February and the leadership team wants a reason by Monday. The usual suspects are returns, a price change, or something wrong with the data. The weekly export per region is in sales.csv: units sold, unit price and units returned.
Please check each one and tell me which explanation the numbers support."
Your answer: one of "returns", "prices", "missing data" or "volume".
When a number moves, list the possible causes first, then test each one with the data before anyone acts on a story. Here the candidates are returns going up, prices going down, real demand falling, or the data itself being incomplete.
Check the boring one early: missing data. A region whose report didn't arrive for a week looks exactly like a sales drop in a total. Counting rows per region per week makes it visible.
The final step turns your findings into a rule, so the same code gives the right answer on next month's data: missing data first, then a rise in the return rate, then a fall in price, and otherwise volume.
weeks = {"East": {"03-02", "03-09"}, "West": {"03-02"}}
all_weeks = set().union(*weeks.values())
[(r, w) for r in weeks for w in sorted(all_weeks - weeks[r])]
Out: [('West', '03-09')]. Compare each region's weeks with the weeks anyone reported.