← All interview questions

Skill Zuno · skillzunos.com · Python Data Science

pandas interview questions

Prepare for pandas interviews on Skill Zuno. This practice book covers pandas interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.

Open pandas on Skill Zuno

Also see the pandas tutorial.

pandas is the most widely used Python library for working with tabular data. Its DataFrame and Series let you load, clean, transform, join, group and summarise data from CSV, Excel, SQL, Parquet and more. pandas interviews cover indexing with loc and iloc, handling missing data, groupby, merging and joining, reshaping, time series, and writing fast, vectorised code.

Sample pandas interview questions

What is the difference between loc and iloc?

loc selects by label, and its slices include the end label. iloc selects by integer position, and its slices exclude the end, like Python lists.

What is the difference between transform and agg in groupby?

agg returns one row per group. transform returns a result the same length as the original DataFrame, such as each row's group mean, which is handy for adding columns.

What causes SettingWithCopyWarning?

Assigning to a slice that may be a copy, such as df[df.a > 0]['b'] = 1, which may not change df. Use df.loc[df.a > 0, 'b'] = 1. With copy-on-write, chained assignment never modifies the original.

What join types does merge support?

inner, left, right, outer and cross, chosen with how=. Use validate='one_to_one' or 'many_to_one' to catch unexpected duplicate keys.

Why is apply often slow?

apply with axis=1 calls a Python function for every row. Vectorised column operations, NumPy functions or np.where run in compiled code and are usually far faster.

What you can practice

  • pandas interview questions for beginners and experienced developers
  • Level-based practice: New, Easy, Medium, Hard, and Diff
  • Python Data Science topics alongside pandas on skillzunos.com

More Python Data Science interview questions

All interview questions