๐ฅ Python Interview Q&A for Data Analysts (Frequently Asked)
Q1๏ธโฃ Difference between loc and iloc in Pandas?
โ
loc โ Label-based indexing (column/row names)
โ
iloc โ Integer-position based indexing
Q2๏ธโฃ How do you handle missing values when deletion is not allowed?
โ
Use fillna() with mean/median/mode or forward/backward fill based on data context.
Q3๏ธโฃ Difference between apply(), map() and applymap()?
โ
map() โ Element-wise on Series
โ
apply() โ Row/column-wise on DataFrame
โ
applymap() โ Element-wise on entire DataFrame
Q4๏ธโฃ How do you remove duplicate records based on specific columns?
โ
df.drop_duplicates(subset=['col1','col2'])
Q5๏ธโฃ Explain groupby() with a real use case.
โ
Used for aggregation like sales by region:
df.groupby('region')['sales'].sum()
Q6๏ธโฃ Difference between merge() and join()?
โ
merge() โ SQL-style joins on columns
โ
join() โ Index-based joining
Q7๏ธโฃ How do you optimize memory usage of a large DataFrame?
โ
Downcast dtypes, convert object to category, drop unused columns.
Q8๏ธโฃ What is vectorization and why is it important?
โ
Performing operations on entire arrays instead of loops โ much faster execution.
๐ฅ React with ๐ฅ / ๐ if you want more Python & Data Analyst interview posts daily!
Post #2021
1.61K
- โค 1