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.

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.

HardTechnical
59 practiced

Explain what Copy-on-Write changed about when a pandas operation returns a view versus a copy, and why it is no longer something you can opt into or out of. Discuss what this means for code that used to rely on chained assignment sometimes working, and general strategies to avoid unnecessary copies and large temporary DataFrames when working with large datasets.

HardTechnical
50 practiced

You discover that a daily Pandas job used by analysts returns different results than a PySpark job that should be equivalent. Outline a systematic debugging approach to reconcile results, including checks for types, null handling, sorting, and sampling. What concrete checks would you run first?

HardTechnical
56 practiced

Discuss when NumPy vectorized aggregation can meaningfully outperform pandas groupby for aggregating millions of rows by category label, and show a concrete example of that speedup. Then explain when pandas' own groupby implementation is preferable despite the difference.

MediumTechnical
63 practiced

You have two DataFrames: prices (timestamp, symbol, price) and trades (timestamp, symbol, quantity). For each trade, you need the most recent price for that symbol at or before the trade's own timestamp. Write pandas code to produce this, explain what ordering your approach depends on, and how you would restrict matches to the same symbol.

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.