pandas
Labelled data: indexes, filtering, and split-apply-combine.
Foundations
4/4The two containers, the index that glues them, and getting data in.
- 1
What a DataFrame actually is
Index, columns, values, dtypes — the four parts every later method moves around.
8 min0/3 - 2
The index, and alignment
Labels take part in the arithmetic — the one idea NumPy doesn’t have.
12 min0/4 - 3
dtypes in pandas
One type per column — plus the nullable and categorical ones pandas had to add.
11 min0/4 - 4
Getting data in
read_csv, and the four calls to run before you trust a single row.
10 min0/4
Selection
4/4Getting at rows and columns — by label, by position, by condition.
- 5
[] vs .loc vs .iloc
Three ways in, three different questions — and the one that silently returns the wrong row.
13 min0/4 - 6
Filtering rows with a boolean mask
Why df[df["cups"] > 100] works, and why the index comes out full of holes.
10 min0/3 - 7
query, isin and between
The readable ways to say a filter, once masks stop scaling.
9 min0/4 - 8
Adding and changing columns
Creating columns, and the chained assignment that silently does nothing.
11 min0/4
Cleaning
4/4Missing values, duplicates, messy text and inconsistent types.
- 9
Missing data
Dropping and filling are different claims — and they give different answers.
12 min0/4 - 10
Duplicates
“Duplicate” is a decision you make, and subset= is where you make it.
9 min0/4 - 11
Text with .str
One capital letter, one wrong number, no error message.
11 min0/4 - 12
Renaming, sorting and dropping
Housekeeping — and the two footguns hiding in it.
10 min0/4
Aggregation
4/4Summarising, grouping, and reshaping into a summary table.
- 13
Summarising a table
describe() is a checklist, not a report — run it on everything.
9 min0/4 - 14
GroupBy: split, apply, combine
The three motions hiding inside every .groupby() call.
12 min0/3 - 15
agg, transform and apply
Told apart by one thing: the shape of what comes back.
13 min0/4 - 16
pivot_table and crosstab
The same aggregation, with the second key across the top instead of down the side.
11 min0/4
Combining & reshaping
4/4Stacking tables, joining them, and switching between wide and long.
- 17
Stacking tables with concat
No keys, no matching — and two traps that come free with alignment.
10 min0/3 - 18
merge and join
The named side is kept in full — and duplicate keys multiply your rows.
13 min0/4 - 19
Wide and long form
Compute in long form, present in wide. Most awkward pandas is a shape problem.
11 min0/3 - 20
MultiIndex, stack and unstack
An index whose labels are tuples — and two methods for moving levels sideways.
12 min0/4
Time series
3/3Dates as a first-class index — resampling, rolling windows, shifts.
- 21
Dates and times
A date read from a file is a string, and strings sort in the wrong order.
12 min0/4 - 22
resample and rolling
One changes how many points there are. The other changes what each one says.
12 min0/4 - 23
shift, diff and change over time
Slide the column down a row, and every “compared to last time” question falls out.
10 min0/4
In practice
2/2Categories, memory, and writing pandas that reads well.
Capstones
3/3Whole projects, end to end.
- 26
Capstone: clean a messy dataset
capstoneThirteen rows, four defects, one pipeline.
20 min0/5 - 27
Capstone: an analysis, end to end
capstoneFrom a messy table to a ranked report — and the two joins that could ruin it.
22 min0/4 - 28
Capstone: a time series report
capstoneIs trade growing, and what does a normal week look like?
20 min0/5
