Reshaping tables with pivots
You will be able to
- Summarise sales by region and month
- Choose between long and wide layouts
sales.pivot_table(
index="region", columns="month",
values="revenue", aggfunc="sum")
Tip: check for duplicate rows before pivoting — they silently inflate your totals.