Explain it in 60 seconds
transform vs agg vs apply in groupby
Data Analyst · Python and Pandas · Intermediate
What is the difference between agg, transform and apply in a pandas groupby?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- agg: one row per group.
- transform: same shape as original (broadcast group stat).
- apply: flexible, any output, slower.
- transform for share-of-group, z-scores.
- Prefer agg/transform for speed.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.