Data Wrangling & Pipelines

Split-Apply-Combine

Split-apply-combine is the general recipe behind group-by: split the data into groups, apply the same operation to each group independently, then combine the results back into one table. It describes computing each class's average grade by handling one class at a time, then stacking the answers.

Naming this pattern matters because it generalizes far beyond simple averages — apply can be any function, including fitting a small model per group or normalizing values within each group. Recognizing a task as split-apply-combine usually points you straight to the right, loop-free tool.