Interview Insights · Pandas
Why Pandas Questions Reveal More Than Any Resume Line
Quick summary — Pandas resume probes
A Pandas keyword on a resume is a claim; predicting what a short snippet prints is evidence. Writing code from a prompt can be rehearsed. Reading code and predicting its output is much harder to fake, because it depends on having seen Pandas behave in surprising ways. Short snippets about groupby dropping missing keys, chained assignment, value_counts and read_csv options quickly show whether a candidate has worked with real data. Project questions then confirm it, because only someone who did the work can explain what broke.
In this guide you will learn:
- Why Pandas resume lines carry so little weight on their own
- Code-reading snippets interviewers use to test real experience
- Surprising default behaviours that daily users know and tutorial users miss
- Project questions that confirm or contradict your resume
- How to write a Pandas line that points to work you can defend
SECTION 01What a Pandas line on a resume cannot tell me
When I see 'Python (Pandas, NumPy, Matplotlib)', I learn that you have heard of the libraries. I do not learn whether you can read a messy CSV, whether you check your merges, or whether you have ever handled a file too large to load comfortably. Every one of those is a daily task in analyst and data science work.
So I translate the line into small probes. Some are code-writing tasks, but my favourite probes are code-reading questions, because they cannot be prepared by memorising answers to common questions.
| Resume phrase | Probe I use | Answer that confirms it | Answer that weakens it |
|---|---|---|---|
| Pandas, NumPy | What does value_counts(normalize=True) return? | Shares that add to 1, sorted descending | The number of unique values |
| Data cleaning | Does groupby keep rows where the key is NaN? | No, not by default; use dropna=False | Yes, it groups them as NaN |
| Handled large datasets | How do you load a big CSV with less memory? | usecols, dtype, category, chunksize | Just a bigger laptop |
| Exploratory analysis | What is the first thing you run on new data? | shape, dtypes, isna().sum(), head | I start plotting |
import pandas as pd
s = pd.Series(['UPI', 'Card', 'UPI', 'Cash', 'UPI', 'Card'])
print(s.value_counts(normalize=True))
# Prediction a daily user gives:
# UPI 0.500000
# Card 0.333333
# Cash 0.166667
# (shares, sorted from most to least frequent)
# Follow-up: what if there are missing values?
s2 = pd.Series(['UPI', None, 'UPI'])
print(s2.value_counts()) # NaN not counted
print(s2.value_counts(dropna=False)) # NaN counted as its own valueimport pandas as pd
import numpy as np
df = pd.DataFrame({'city': ['Delhi', np.nan, 'Delhi', 'Pune'],
'sales': [100, 250, 50, 80]})
print(df.groupby('city')['sales'].sum())
# city
# Delhi 150
# Pune 80
# The 250 from the missing city is silently gone.
print(df.groupby('city', dropna=False)['sales'].sum())
# Delhi 150
# Pune 80
# NaN 250
print(df['sales'].sum()) # 480, so totals no longer match
The groupby snippet is the one I find most revealing. Candidates who have reconciled report totals have met it before, usually when a city-wise sum did not match the overall total. Candidates who only followed tutorials usually predict that NaN appears as a group.
SECTION 02The code-reading questions that separate daily users
Beyond value_counts and groupby, a handful of snippets come up again and again in my rounds. Each one shows a Pandas behaviour that is easy to miss when you only write code from examples. If you can predict all of them and explain why, your resume line is already confirmed.
The most important one is chained assignment. It produces a warning that many learners ignore, and in some cases the change you intended never reaches the original DataFrame.
| Snippet idea | What many predict | What actually happens | Why it matters at work |
|---|---|---|---|
| df[df.x > 0]['y'] = 1 | y becomes 1 for those rows | Warning; original df may not change | Silent missing updates in reports |
| pivot with duplicate index-column pairs | It sums the duplicates | ValueError; use pivot_table | Reports built on duplicate keys |
| df.sort_values('a') then df.head() | Sorted rows | Unsorted; result was not assigned | Thinking a step happened when it did not |
| pd.to_datetime('05/03/2025') | 5 March 2025 | 3 May by default, month first | Swapped dates in Indian data |
import pandas as pd
df = pd.DataFrame({'amount': [500, 7000, 9000],
'flag': [0, 0, 0]})
# Chained: filter, then set on the result
df[df['amount'] > 5000]['flag'] = 1
# SettingWithCopyWarning (or ChainedAssignment warning)
print(df['flag'].tolist()) # [0, 0, 0] - nothing changed
# Correct: one .loc call with row mask and column
df.loc[df['amount'] > 5000, 'flag'] = 1
print(df['flag'].tolist()) # [0, 1, 1]import pandas as pd
sales = pd.DataFrame({
'city': ['Delhi', 'Delhi', 'Pune'],
'month': ['Jan', 'Jan', 'Jan'],
'amt': [100, 50, 80]
})
# sales.pivot(index='city', columns='month', values='amt')
# ValueError: Index contains duplicate entries, cannot reshape
print(sales.pivot_table(index='city', columns='month',
values='amt', aggfunc='sum'))
# month Jan
# city
# Delhi 150
# Pune 80
# Note: pivot_table's default aggfunc is 'mean', so
# always pass aggfunc explicitly.
Notice the last comment in the pivot_table tab. Its default aggregation is the mean, not the sum. A candidate who mentions that without being asked is clearly someone who has been surprised by it in real work.
If you get a snippet wrong, explain your reasoning anyway. 'I expected the filter to return a view, but it returned a copy' shows you understand the concept even if you missed the detail.
SECTION 03Project questions that confirm or contradict your resume
The final layer is your own project. If your resume says you cleaned and analysed a dataset with Pandas, I will ask about specific decisions. What was messy? What did you check after merging? How big was the file and how did you load it? These questions have no textbook answer. They can only be answered from memory of doing the work.
This is also where a specific resume line helps you. If the line names the data and the problem, my questions land on things you remember well.
| Project question | Strong answer contains | Weak answer contains | What I conclude |
|---|---|---|---|
| What was the messiest column? | A named column and the exact fix | 'Some nulls, I dropped them' | Whether you looked at the data closely |
| How did you load the file? | dtype, parse_dates or usecols choices | 'pd.read_csv, nothing special' | Whether size or types were a concern |
| What did you check after merging? | Row counts and unmatched keys | 'It merged fine' | Whether you verify results |
| What would you change now? | A specific improvement with a reason | 'Nothing, it worked' | Whether you reflect on your work |
import pandas as pd
# A strong candidate can explain each argument
orders = pd.read_csv(
'orders.csv',
usecols=['order_id', 'customer_id', 'city', 'order_date', 'amount'],
dtype={'customer_id': 'string', 'city': 'category'},
parse_dates=['order_date'],
dayfirst=True
)
print(orders.dtypes)
print(orders.memory_usage(deep=True).sum() / 1024**2, 'MB')
# Very large file: process in chunks
total = 0
for chunk in pd.read_csv('orders.csv', usecols=['amount'], chunksize=100_000):
total += chunk['amount'].sum()
print(total)BEFORE
Skills: Python (Pandas, NumPy, Matplotlib),
Data Cleaning, EDA, Large Datasets
AFTER
Project: E-commerce Orders Analysis (Python, Pandas)
- Loaded orders and customers CSVs with explicit dtypes
and dayfirst date parsing; converted city to category
to reduce memory
- Fixed duplicate customer IDs before merging and
verified row counts with validate='many_to_one'
- Built month-wise revenue and repeat-purchase metrics
with groupby, transform and pivot_table
Every bullet invites a question you can answer.
The rewritten line is longer, but it does something the keyword list cannot: it tells me exactly which questions to ask, and each of them is one you have already answered once, while doing the project.
SECTION 04Self-test: can you defend your Pandas line?
Use these three sheets to test whether your Pandas resume line will hold up. Predict each snippet output before running it, then answer the project questions out loud as if an interviewer had asked them.
WRITE YOUR PREDICTION, THEN RUN IT
1. pd.Series(['a','b','a']).value_counts(normalize=True)
2. df.groupby('k')['v'].sum() where k has NaN
3. df[df.v > 0]['w'] = 1 then print df['w']
4. df.pivot(...) with duplicate index/column pairs
5. df.pivot_table(...) with no aggfunc given
6. pd.to_datetime('05/03/2025')
7. df.sort_values('v'); df.head()
8. pd.Series([1, None, 3]).mean()
Score: ___ / 8 correct before running.
Below 6 -> practise before listing Pandas.ANSWER OUT LOUD, 60 SECONDS EACH
1. What did the raw data look like?
2. Which column needed the most cleaning, and how?
3. How did you load the file, and why those options?
4. Which merge did you use, and what did you check?
5. One number in your results: how did you verify it?
6. One thing that broke and how you found it.
7. What would you do differently now?
If any answer starts with 'I think I...' -> reopen
the notebook and refresh your memory.BUILD EACH PANDAS BULLET LIKE THIS
[Action verb] + [data] + [Pandas method] + [check/result]
Examples:
- Cleaned 3 messy date and amount columns with
to_datetime and to_numeric, logging rows that failed
- Merged orders with customers using validate to
catch duplicate keys
- Built monthly retention table with groupby and
pivot_table
Rule: no bullet you cannot explain line by line.
SECTION 05Habits that make your Pandas claims believable
These habits come from working on real data, and interviewers can hear them in your answers.
- Know the surprising defaults — groupby drops NaN keys, value_counts skips NaN and pivot_table averages by default. Knowing these signals real use.
- Change values with one loc call — Using df.loc[mask, 'col'] = value avoids chained assignment and shows you have dealt with the warning before.
- Load files deliberately — Choosing usecols, dtype and parse_dates shows you think about memory and types before analysis starts.
- Keep a problems log — Write down every Pandas surprise you meet in a project. That log becomes your best source of interview stories.
- Re-run before interviews — Open your project notebook a day before and run it fully, so every detail is fresh when questions start.
SECTION 06Interview Q&A — Pandas resume probes
Q1Does groupby include NaN values in the group keys?
Not by default. Rows where the grouping key is NaN are excluded, so their values disappear from the result. If you want them as a separate group, pass dropna=False. I always compare the group totals with the overall total to catch this.
Q2What is SettingWithCopyWarning and how do you fix it?
It warns that you may be setting values on a copy of a slice rather than on the original DataFrame, usually because of chained indexing like df[mask]['col'] = value. The fix is a single .loc call: df.loc[mask, 'col'] = value. If I really want a separate DataFrame, I use .copy() explicitly.
Q3What is the difference between pivot and pivot_table?
pivot only reshapes and fails if there are duplicate index and column pairs. pivot_table aggregates duplicates using aggfunc, which defaults to mean, and supports margins and fill_value. For reports I usually use pivot_table and always pass aggfunc explicitly.
Q4How do you reduce memory when loading a large CSV in Pandas?
Load only the needed columns with usecols, set dtypes explicitly, convert repeated text like city names to category, and parse dates on load. If the file still does not fit, I process it in chunks with chunksize and aggregate each chunk.
Q5What does value_counts(normalize=True) return?
It returns the share of each unique value instead of the count, so the values add up to 1. The result is sorted from most to least frequent. Missing values are excluded unless I pass dropna=False.
SECTION 07Test yourself — Pandas resume probes quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
How should I write Pandas on my resume?
Connect it to a project and name what you did: the data, the Pandas methods and how you checked the result. For example, 'Merged orders and customers with validate to catch duplicate keys'. Avoid a long keyword list you cannot defend.
What Pandas questions are asked for freshers?
Expect questions on reading files, selecting with loc and iloc, filtering, handling missing values, groupby, merge, pivot tables and dates. Many interviewers also show a short snippet and ask you to predict its output.
What is a code-reading question in a Python interview?
It is a question where the interviewer shows a few lines of code and asks what they will print or do. It tests understanding of how the library actually behaves, including defaults and edge cases, rather than memorised syntax.
Why does my groupby total not match the overall total?
Most often because some rows have a missing value in the grouping column, and groupby drops them by default. Use dropna=False or fill the missing keys with a label such as 'Unknown', then compare totals again.
How do I prepare for Pandas project questions in interviews?
Re-run your project notebook, list every problem you met and how you fixed it, and practise explaining your loading, cleaning, merging and verification steps out loud. Interviewers want specific decisions, not general descriptions.
Where can I practise Pandas interview questions with expert feedback?
Yes. Uncodemy's Python Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise Pandas interview questions with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.
SECTION 09Related reads
Classroom & online · Noida
Make your Pandas line something you can defend
Our Python Training Course teaches Pandas through real projects and code-reading practice, so every skill on your resume is backed by work you can explain line by line.
Talk to a counsellor for current fees- Real-data Pandas projects
- Code-reading drills
- Resume and project review
- Weekday & weekend batches