Skip to content
ML Academy

SQL and Python

Interview question

  • midlevel
  • 8 minsuggested time
  • 2Data scientist, Data analyst

A colleague computes average load factor per market in pandas with df.groupby("market")["load_factor"].mean() and reports it as "market load factor". Some rows have a missing market. What is wrong or risky, and what would you write instead?

Tests: pandas groupby semantics (dropped null groups, transform vs agg, categorical groupers) and the mean-of-ratios vs ratio-of-sums distinction.

Sign in to practise: answers are saved before model answers are shown.