Pandas Top 20 Functions for Data Analyst Interviews 2026 | Data Analyst Interview
🐍 Pandas Reference

Pandas — Top 20 Functions for Data Analyst Interviews 2026

The 20 Pandas methods that appear in 80% of data analyst interviews — explained with real code examples you can run and adapt immediately.

20 Functions
Master these and you handle any Pandas interview question

Every function below has appeared in real interview questions at top companies in 2025–2026.

Easy

1. df.head(n) / df.tail(n) — preview first or last n rows

Exploration · Always the first step when receiving a new dataset
Easy

2. df.info() — column names, dtypes, non-null counts

Exploration · Tells you which columns have nulls and wrong types in one call
Easy

3. df.describe() — summary statistics for all numeric columns

Statistics · Count, mean, std, min, 25th/50th/75th percentile, max
Easy

4. df.value_counts() — frequency count of a categorical column

Exploration · df[‘category’].value_counts() — add normalize=True for %
Easy

5. df.isna().sum() — count missing values per column

Data Quality · df.isna().sum() / len(df) * 100 gives % missing per column
Medium

6. df.loc[rows, cols] — label-based selection

Selection · df.loc[df[‘city’]==’Mumbai’, [‘name’,’revenue’]] — label + condition
Medium

7. df.groupby().agg() — group and aggregate with named results

Aggregation · df.groupby(‘region’).agg(revenue=(‘amount’,’sum’), orders=(‘id’,’count’))
Medium

8. pd.merge(df1, df2, how, on) — join two DataFrames

Joining · how=’inner’/’left’/’right’/’outer’ — mirrors SQL JOIN types exactly
Medium

9. df.sort_values(col, ascending=False) — sort rows

Sorting · .head(10) after sort_values gives top-N — extremely common interview pattern
Medium

10. df.fillna(value) / df.dropna() — handle missing values

Cleaning · fillna(df[‘col’].median()) for numerical, dropna(subset=[‘key_col’]) for rows
Medium

11. df.drop_duplicates(subset) — remove duplicate rows

Cleaning · subset=[‘user_id’,’date’] keeps first occurrence of each user per day
Medium

12. df[‘col’].str.contains() / str.replace() — string operations

Strings · Vectorised string methods — no loop needed. df[df[’email’].str.contains(‘@gmail’)]
Medium

13. pd.to_datetime() + dt accessor — date parsing and extraction

Dates · df[‘date’].dt.year, dt.month, dt.day_name(), dt.to_period(‘M’)
Medium

14. df.pivot_table(index, columns, values, aggfunc) — reshape wide

Reshaping · Monthly revenue by category in one line — staple of take-home tasks
Medium

15. df.rename(columns={}) / df.assign() — rename and add columns

Wrangling · df.assign(margin=df[‘revenue’]-df[‘cost’]) — cleaner than df[‘col’]=
Hard

16. df.groupby().transform() — broadcast group aggregates back to rows

Advanced · df[‘pct_of_total’] = df[‘revenue’] / df.groupby(‘region’)[‘revenue’].transform(‘sum’)
Hard

17. df.apply(func, axis) — apply custom function row or column wise

Advanced · Use only when no vectorised alternative exists — show interviewer you know the performance trade-off
Hard

18. pd.cut() / pd.qcut() — bin continuous variable into categories

Segmentation · pd.cut(df[‘age’], bins=[0,25,40,100], labels=[‘Young’,’Mid’,’Senior’])
Hard

19. df.melt(id_vars, value_vars) — unpivot wide to long format

Reshaping · Opposite of pivot_table — turns column headers into rows for tidy data
Hard

20. df.shift() / df.pct_change() — lag and growth rate on time series

Time Series · df[‘mom_growth’] = df[‘revenue’].pct_change() * 100 — one-line MoM in Python

Want to practise these in a live Pandas mock?

Book a free Python mock — we test you on groupby, merge, pivot, and time series questions just like real interviews.

Book Free Python Mock