All 45 pandas exercises
Pandasdrill is pandas practice in your browser. Every exercise shows you a small, realistic table and a task. You write Python in the editor, run it on real pandas, see your result as a table, and get it checked on the spot and again on a second dataset, so code that only fits the sample fails. The exercises are listed here level by level. 5 are free without an account; Pro unlocks the rest.
Level 1: Selecting and filtering
Columns, loc and iloc, boolean masks, isin, between, query, sorting, head and nlargest.
Level 2: Cleaning
Missing values, astype, string methods like strip, contains and extract, duplicates, rename, replace and dates.
Level 3: Aggregating
groupby with sum, mean and count, named aggregations, value_counts, pivot_table and crosstab.
Level 4: Combining and reshaping
Inner and left merges, keys with different names, concat, melt, pivot, stack and unstack.
Level 5: Analysis
Rolling averages, pct_change, cumsum, rank, shift, monthly resampling, cut and qcut, apply with a function.
Try the first five exercises free.
No sign-up needed for the first five. If it works for you, Pro unlocks all 45, and a free account saves your progress and your code across devices.
Start practicing free