Pandasdrill

Get fluent in pandas by writing it.

45 hands-on exercises on small, realistic tables. Write Python in your browser, run it on real pandas, and get your result checked on the spot.

A laptop showing a grid of data next to a potted bamboo plant

Read the task, write the code, see the result.

  1. 01
    Look at the dataEach exercise shows its tables, so you know the columns and values before you start.
  2. 02
    Write pandasType in the editor and press Run to see your result as a table, with print output and readable errors.
  3. 03
    Check itWrong type, wrong shape, wrong columns, the first value that differs, or code that only fits the sample. Hints and a reference solution follow.

Five levels, from your first filter to resampling.

01Selecting and filteringColumns, loc and iloc, boolean masks, isin, between, query, sorting, head and nlargest.
02CleaningMissing values, astype, string methods like strip, contains and extract, duplicates, rename, replace and dates.
03Aggregatinggroupby with sum, mean and count, named aggregations, value_counts, pivot_table and crosstab.
04Combining and reshapingInner and left merges, keys with different names, concat, melt, pivot, stack and unstack.
05AnalysisRolling averages, pct_change, cumsum, rank, shift, monthly resampling, cut and qcut, apply with a function.

Timed mode for real speed.Each exercise gets a clock. Hints and solutions stay locked until time is up, and your best times are kept.

Start free. Pay once you are hooked.

Free

$0
  • The first 5 exercises
  • Real pandas in your browser
  • Instant checking, hints and timed mode
Start free

Pro

All 45
  • Cleaning, groupby, merges, reshaping and time series
  • Reference solutions with explanations
  • Progress and best times saved to your account

Payments open soon. The free exercises work now.

Questions

Who is this for?

Data analysts and students who know some Python and want pandas to feel natural: people moving over from Excel or SQL, and anyone who keeps looking up the same groupby syntax.

Do I need to install anything?

No. Your code runs on real pandas inside your browser, through Pyodide, a version of Python built for the web. The first run downloads it, which takes about 10 seconds; after that it is cached.

How is my code checked?

Your code runs on the sample tables, and then again on a second dataset with different rows and values, and your result variable is compared with the expected answer each time. Small differences like int versus float do not count against you. If the answer is off, you are told whether the type, shape, columns, values or order is wrong, and if code only fits the sample, that is flagged too.

Do I need an account?

No. The first five exercises work without one and save progress in your browser. A free account saves progress across devices, and Pro unlocks the rest.

How do I cancel the monthly plan?

Open Account and choose Cancel subscription. That is the whole process: you keep Pro until the end of the period you paid for and are not charged again. If Pro is not for you, you get a full refund within 14 days of paying.

What if my answer is right but marked wrong?

Answers are checked on the result they produce, not on how they are written, so any correct answer passes. If a check still gets it wrong, use the report link under the result. Reports are reviewed, and a check that is wrong gets fixed.