pandas interview question

Explain groupby in pandas: split-apply-combine, agg, transform and filter.

How it works Asked in Machine Learning Engineer · Data Engineer interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

groupby splits rows into groups by keys, applies a function to each group, and combines the results. agg returns one row per group (sums, means), transform returns a value per original row (for example each row's share of its group total), and filter keeps or drops whole groups by a condition.

Keep reading with a membership

The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.

See plans and free trial Already a member? Sign in

More pandas questions

← All pandas questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake