Pandasdrill

Free pandas practice test for interviews

Ten hands-on questions you answer by writing real pandas code against DataFrames, one 15-minute clock, and a score broken down by skill area. No sign-up to start.

Questions
10
Minutes
15
Skill areas
5
Price
Free
result.describe()Example result

Working knowledge

Correct
7 of 10
Time
13:11 of 15:00
Skill areaScoreShare correct
Selecting and filtering2/2
Strong
Cleaning1/2
Review
Aggregating2/2
Strong
Combining and reshaping1/2
Review
Analysis1/2
Review
An example of the result you get: a score, your time, and each skill area marked.

What the test covers

pandas screens for analyst and data roles draw on the same short list of skills. The test takes two questions from each of the five, picked at random each time.

  • Selecting and filtering

    Boolean masks, loc and iloc, matching a list or a range of values, sorting and the top rows. loc, iloc, isin, query, sort_values

    2 of 1013 exercises
  • Cleaning

    Missing values, messy text, numbers and dates stored as text, and duplicate records. fillna, astype, str, drop_duplicates, to_datetime

    2 of 1016 exercises
  • Aggregating

    Totals and counts per group, named aggregations, pivot tables and shares of a group total. groupby, agg, pivot_table, transform

    2 of 1017 exercises
  • Combining and reshaping

    Inner, left and outer merges, stacking tables, and moving between wide and long layouts. merge, concat, melt, pivot, explode

    2 of 1016 exercises
  • Analysis

    Rolling averages, change from the previous period, running totals, ranking within a group and binning. rolling, pct_change, cumsum, rank, resample

    2 of 1017 exercises
No sign-up. No card.

Three sample questions

These come from the same pool as the test. In the test you write the code in an editor, run it on the DataFrames as often as you like, and your result is checked on the data you see and again on a second dataset.

Q1Remove duplicate records

Cleaning

The leads table has repeated emails. Keep only the most recent row for each email, which is the last one in the table. Keep the original row labels.

leads6 rows

emailsourcescore
0a@x.comad10
1b@x.comweb25
2a@x.comevent40
3c@x.comweb15
4b@x.comad30
5d@x.comreferral20
Show the answer

Coderesult = leads.drop_duplicates(subset="email", keep="last")

Rows only count as duplicates on the columns in subset. keep="last" keeps the final occurrence of each email, which is the newest record here. With no subset, rows that differ in source or score are not duplicates at all.

Open this exercise

Q2Named aggregations

Aggregating

For each region, return a DataFrame with three columns: total_revenue (sum of revenue), orders (number of orders) and avg_units (mean units). Index by region.

sales12 rows

order_idregionrepproductunitsrevenuequarter
01001EastAvaWidget5250Q1
11002WestZedGadget3180Q1
21003EastAvaGizmo8320Q1
31004NorthMoeWidget2100Q1
41005WestZedWidget7350Q2
51006EastAvaGadget4240Q2
61007NorthMoeGizmo6240Q2
71008WestZedWidget150Q2
81009EastBeaWidget9450Q1
91010NorthZedGizmo3120Q2
101011WestMoeGizmo280Q1
111012SouthCalWidget4200Q2
Show the answer

Coderesult = sales.groupby("region").agg( total_revenue=("revenue", "sum"), orders=("order_id", "count"), avg_units=("units", "mean"), )

Named aggregation lets you pick the source column, the function and the output name in one place. Each keyword becomes a column of the result, in the order you write them.

Open this exercise

Q3Left merge keeps every order

Combining and reshaping

Join orders to customers on cust_id, keeping every order. Orders with an unknown customer get missing name and city.

orders7 rows

order_idcust_idproduct_idqty
05011P12
15023P21
25032P15
35041P33
45055P22
55063P44
65074P11

customers5 rows

cust_idnamecity
01AcmeAustin
12BirchBoston
23CobaltAustin
34DuneDenver
46ElmBoston
Show the answer

Coderesult = orders.merge(customers, on="cust_id", how="left")

A left merge keeps every row of the left table and fills the right table's columns with NaN where no match exists. That is the usual choice when the left table is the one you are reporting on.

Open this exercise

How scoring works

  • Each question is worth one point. You get the point when the value you put in result matches the expected output on the sample data and again on a second dataset with different rows, so a hard-coded answer does not score.
  • You can run and check your code as often as you like while the clock runs. A question you skip, or have not solved when the 15 minutes end, counts as wrong.
  • The result shows your score out of 10, the time you took, and each skill area as strong or to review, with links to the exercises for the areas you missed.

What your score means

  • 0 to 4Build the basics first

    Start with the first levels and work up. Short daily practice moves this score quickly.

  • 5 to 7Working knowledge

    The core is there. The areas you missed are the ones to drill before a timed screen.

  • 8 to 10Interview-ready on this set

    You solved questions from nearly every level under the clock. Drill the one or two areas you missed and you are in good shape.

These bands describe this test only. Employers set their own pass marks, and we do not know them.

Take the test

10 questions from 5 skill areas, 15 minutes on the clock. It starts right here, with no account and no email.

  • Python and pandas load into your browser when you press Start, about 10 seconds the first time.
  • Hints and solutions are off while the clock runs.
  • Run and check your code as often as you like. Skip counts as wrong.
  • Your answers survive a page reload.

The mistakes that cost the most points

Six slips worth fixing before a timed pandas test. Each one fails the check on Pandasdrill.

  • Chained conditions without brackets. A mask like df[df.a > 1 & df.b < 5] fails, because & binds tighter than the comparisons. Wrap each condition: (df.a > 1) & (df.b < 5).
  • An inner merge that drops rows. merge keeps only the keys found on both sides unless you pass how="left", so orders with an unknown customer disappear without an error.
  • A grouped result with the wrong shape. groupby returns the keys as the index. When the question asks for a flat table, pass as_index=False or call reset_index.
  • Text that looks like numbers. A price column read as text sorts and sums wrongly. Convert it with astype or pd.to_numeric before any math.
  • Values copied from the sample. Filtering on the row labels or names you can see passes on the sample and fails on the second dataset every answer here is checked against.
  • Forgetting to assign. Most pandas methods return a new object, so df.sort_values("a") on its own line changes nothing. Assign the result.

The three formats a pandas test comes in

  • Multiple choice about pandas knowledge: what loc and iloc select, what a left merge keeps, what axis=1 means.
  • Live coding against DataFrames, usually timed: read the data, write the code, return the right table. This test is that format, because knowing a method and writing it under a clock are different skills.
  • A take-home notebook: a raw file and a list of business questions. Accuracy matters more than speed, and cleaning the data is tested as much as the analysis.

Questions

Is the pandas practice test really free?

Yes. The test is free and you do not need a card. Free visitors get one attempt a day; Pro members can retake it any time.

Do I need an account or Python installed?

No to both. The test starts in one click and runs real Python with pandas inside your browser, with the DataFrames already loaded. Python downloads when you press Start, which takes about 10 seconds the first time.

How long does the test take?

Up to 15 minutes. There are 10 questions on one clock, and the test ends when you finish the last question or the time runs out.

How is the test scored?

One point per question, 10 in total. Your code scores when its result matches the expected output on the sample data and again on a second dataset. Skipped or unsolved questions count as wrong. You also get a breakdown by skill area.

Is it like the pandas test employers use?

It uses the hands-on format: you write real code against DataFrames under a clock, which is how live pandas screens and online coding assessments work. It is not a copy of any employer's or testing company's test, and it does not include multiple-choice questions, plotting or machine learning.

Can I retake the test?

Yes. The questions are drawn at random from the exercise pool, so a retake is a different test. Free visitors can retake it the next day; Pro removes the limit.

What comes after the test?

Your result links straight to the exercises for the areas you missed. Your first 8 exercises on Pandasdrill are free without an account, and questions you solve in the test count toward them. Pro unlocks all 79 exercises, every reference solution, timed mode and the certificate.

Find out where you stand

Ten questions, 15 minutes, a score by skill area. Free, and no sign-up to start.