← All Python interview questions
Fill missing product ratings the defensible way
EasyPandas — CleaningAmazonNykaa
A ratings export has gaps. The analytics lead wants missing ratings filled with the median rating of that product's category, not a global constant.
Write fill_ratings(df) that returns a copy of the DataFrame with the rating column filled that way, rounded to 2 decimals. The original DataFrame must not change.
More Pandas — Cleaning questions
Practising alone only goes so far — our live cohorts pair Python and Pandas depth with dashboards, agentic analytics projects and mock interviews.
Explore the program