pandas, by Running It

Labelled data - the index that drives everything, the copy warnings, the joins and the group-bys, each one runnable on the page.

26 modules Free, no login Updated 15 October 2026

About this track

A DataFrame is not a spreadsheet and not a two-dimensional array. It is a set of columns, each with its own dtype, sharing one index - and almost everything that surprises people about pandas comes from that index doing work they did not ask it to do.

This track works up from the Series and the index to selection, missing data, group-by, joins, reshaping and time series. Every idea arrives as a small program you can run and change on the page.

Every example runs in the browser against pandas itself, and several demonstrate a failure rather than describing it - the assignment that silently does nothing, the merge that multiplies rows, the group-by whose totals no longer add up.

What you will be able to do

How the track is ordered

The Series and the index come first, because nearly every pandas surprise traces back to the index doing work you did not ask for. Selection follows, and then the copy warning, which gets a module to itself because nothing else in the library wastes as much of people's time. Cleaning comes next - dtypes, missing values, duplicates, text and dates - since that is where most real work goes. Only then the aggregation everyone thinks of as the point: group-by, joins, reshaping, time series, and the performance rules that decide whether any of it finishes.

Where this leads

pandas sits on NumPy and feeds matplotlib, scikit-learn and most data pipelines. The NumPy track explains the array layer underneath; the matplotlib track picks up where df.plot stops being enough.

All 26 modules, in teaching order

  1. 01What pandas Is ForLearn what pandas adds to NumPy: named columns, typed data, a row index and the operations that make tabular analysis fast.
  2. 02The IndexSee how the pandas Index labels rows, aligns data during joins and arithmetic, and changes the result of almost every operation.
  3. 03Creating DataFramesBuild pandas DataFrames from dictionaries, lists of records, NumPy arrays and CSV files. See which constructor fits each data shape.
  4. 04Looking at DataRun shape, dtypes, describe, info, head and value_counts on a new dataset. Build the six-call habit that catches problems before analysis.
  5. 05loc and ilocSelect rows and columns by label with loc and by position with iloc. See the endpoint rule that differs between them and why it matters.
  6. 06Filtering RowsFilter pandas rows with boolean masks, isin, between and query. Learn the parenthesis rule for combining conditions that trips every beginner.
  7. 07The Copy WarningUnderstand why chained indexing makes assignments silently fail, and how to write the line that actually changes the DataFrame.
  8. 08Adding and Removing ColumnsAdd, rename and drop columns in a pandas DataFrame with assign and drop. See how index alignment decides what a new column contains.
  9. 09Dtypes and MemoryInspect and convert column dtypes in a pandas DataFrame. Switch object columns to category or nullable types and measure the memory saved.
  10. 10Missing DataFind, count and handle missing values in a pandas DataFrame with isna, dropna and fillna. Pick a strategy based on why the data is missing.
  11. 11DuplicatesFind, count and remove duplicate rows in a pandas DataFrame. Choose which copy to keep and verify the cleaned result matches expectations.
  12. 12Text ColumnsUse the .str accessor to split, replace and test text columns, and learn how each method handles missing values.
  13. 13Dates and TimesParse date strings into pandas datetime, use the dt accessor for components and resample time series. Fix the text dates that break analysis.
  14. 14Sorting and RankingSort rows by one column or several, find the top N values with nlargest, and see where NaN lands in each method.
  15. 15groupbySplit a DataFrame by one or more columns, apply aggregations and combine the results. See the split-apply-combine pattern that defines groupby.
  16. 16transform and filterUse transform to broadcast group statistics back to every row and filter to keep only groups that pass a test. Compare both to plain groupby.
  17. 17Counting and BinningCount category frequencies with value_counts, bin continuous data with cut and qcut, and build cross-tabulations with crosstab in pandas.
  18. 18apply, map and VectorisingUse apply, map and applymap on a pandas DataFrame. Measure the speed cost and see the vectorised alternatives that usually replace them.
  19. 19Stacking Frames with concatStack DataFrames vertically or horizontally with pandas concat. Control index alignment, handle mismatched columns and reset the index.
  20. 20merge and joinJoin two DataFrames with pandas merge using inner, left, right and outer joins. Spot the duplicate key that silently multiplies your rows.
  21. 21Reshaping: pivot and meltReshape a pandas DataFrame from long to wide with pivot_table and back again with melt. See when each shape is the right one for your task.
  22. 22The MultiIndexBuild and slice a pandas MultiIndex on rows or columns. Use xs and IndexSlice for clean lookups and see when to call reset_index instead.
  23. 23Time SeriesResample timestamps into intervals, compute rolling averages, and shift rows forward or back to compare periods side by side.
  24. 24Reading and Writing FilesRead CSV files into DataFrames with the right arguments and avoid the silent bugs that wrong defaults let through.
  25. 25PerformanceProfile a slow pandas workflow and fix the top bottlenecks. Replace row-level loops, shrink memory with better dtypes and go vectorised.
  26. 26Method ChainingWrite a pandas analysis as one chained expression. Compare chained and step-by-step styles and see when pipe and assign keep the chain clean.

Other tracks