Cleaning & transforming data

Pivots & summaries

Pivot tables, group-bys, running totals and rankings — in pandas and in the workbook.

Long-format sales rows by region and month become a pivot table with regions down the side, months across the top and totals in the cells.Long-format sales rows by region and month become a pivot table with regions down the side, months across the top and totals in the cells.long rows in, a summary grid outABC1RegionMonthSales2NorthJan4103NorthFeb3884SouthJan2955SouthFeb342pivot_tableJan · FebNorth 410 · 388South 295 · 342

Start with the full guides

The long-form treatment of pivots & summaries, with the reasoning the shorter pages assume.

Step-by-step how-tos

One task each, with code you can copy, run and adapt.

Follow it through a track

Prefer an ordered route? These tracks cover pivots & summaries along the way, in the order that builds on itself.

Related topics

Subjects that keep turning up on the same pages as this one, most overlap first.

Pivots & summaries is part of Cleaning & transforming data.