← All notes

pandas groupby: split-apply-combine

Answer: A group by operation in pandas involves splitting the data into groups based on some criteria, applying a function to each group, and combining the results. Out of these, the split step is the most straightforward. (S1) The apply and combine steps are typically done together in pandas. (S2)

What you can do per group

In practice

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: pandas docs, Group by: split-apply-combine — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE); pandas docs, How to calculate summary statistics — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE).

Cite this

Permanent ID: iil:note:sdrk92mw

iinventedlight. 2026. "pandas groupby: split-apply-combine." iinventedlight Library, iil:note:sdrk92mw, version of 2026-11-04. https://iinventedlight.com/library/notes/pandas-groupby/. License: CC-BY-4.0.

@misc{iil_note_sdrk92mw,
  author = {{iinventedlight}},
  title = {{pandas groupby: split-apply-combine}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/pandas-groupby/},
  note = {Permanent ID iil:note:sdrk92mw. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/pandas-groupby.md.