core Estimated learning time: 8 h

3.3 Pandas: groupby, joins, reshaping, time series

You can answer a business question with five lines of Pandas.

Before:01. Mathematics for Machine Learning02. Python — Basics to AdvancedUnlocks:05. Classical Machine Learning

Groupby, joins and reshaping are the verbs of real analysis — most business questions are a groupby and a merge away — and time-series operations come almost free once the index is datetimes. It sits at the centre of the data module as the working toolkit. The trap that corrupts results silently is the non-unique join key: merge will happily multiply rows, and checking row counts before and after a merge is the two-second habit that catches it.

Work through these

  • groupby, agg, transform, apply

    Splitting a table by a key and computing something per group, with three different ways of putting the answer back. Choosing among them is the main skill in this topic.

  • merge, join, concat and the duplicate-row trap

    Combining tables on a key, and the trap where a many-to-many match silently multiplies your rows. Checking row counts before and after is the habit that catches it.

  • pivot, melt, stack, unstack

    Turning rows into columns and back again, which is how data moves between the shape people read and the shape analysis needs. This reshaping is required more often than anything else here.

  • Datetime index, resampling, rolling windows

    Working with a time-based index, aggregating to coarser periods, and computing over a moving window. These three cover most time-series manipulation in practice.

Sign in to keep your progress.

Free resources

Links last checked 29 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.