How can you iterate over the groups produced by groupby(), and when is that useful?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks how to loop over the groups of a pandas groupby() result and when an explicit loop is the right choice. Tests knowledge of what each iteration yields, multi-column keys, fetching a single group, and the performance trade-off against built-in aggregation.