InterviewStack.io LogoInterviewStack.io

Python and Pandas for Data Analysis Questions

Programmatic data manipulation and analysis in Python and R. Covers pandas transformations, joins and reshaping, aggregation, working with PySpark for larger data, and using R for statistical analysis. Emphasizes clean, reproducible analytical code.

EasyTechnical
53 practiced

In Pandas, explain and demonstrate with code examples the difference between a left, inner, right, and outer merge. Use the merge indicator option to show which rows did not match and describe a common reason why merges can unintentionally explode (duplicate keys).

HardTechnical
56 practiced

A churn dataset has missing values in income, last_login, and plan_type, and the missingness seems to come from different sources rather than one system bug. How would you decide whether to impute, drop, or flag each field before modeling, and what would you check to make sure the choice is not biasing the model or hiding an important signal?

EasyTechnical
64 practiced

Describe when to use pivot vs melt in pandas. Given a DataFrame sales with columns ['date','store_id','product','units_sold'], show code to create a pivoted table with store_id as rows, product as columns and sum of units_sold, then show how to revert that wide table back to the original long format using melt.

MediumTechnical
53 practiced

Show an example of composing a pandas ETL pipeline using method chaining and .pipe for readability and testability. Include steps: read from CSV, filter rows, impute missing values, create features, and write out partitioned parquet. Explain how you would unit-test each independent function used in the pipeline.

EasyTechnical
51 practiced

Explain how to inspect the schema and quality of a newly loaded DataFrame. Provide pandas code to show column dtypes, basic descriptive statistics for numeric and categorical columns, percent missing per column, and a sample of unique values for a chosen categorical column.

Unlock Full Question Bank

Get access to all Python and Pandas for Data Analysis interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.