NeuroNomixer
  • Home
  • Blog
  • Visual Guides
  • Authors
  • Contact
Sign InSign Up
HomeBlogAuthorsContactPrivacy Policy

© 2026 NeuroNomixer — Built with Next.js & Tailwind CSS

Visual Guides/Split, Apply, Combine
Data & Analysis

Split, Apply, Combine

Every "average X per Y" question is the same three-step move: split the rows into groups, apply one function to each group, and combine the answers into a new, smaller table. Run it live on a real table below.

Two single-level groupings (0/2)
Build a two-level pivot
Translate questions (0/2)

Sign in to save progress

Row-level questions vs group-level questions

"What was the revenue of transaction 7?" is a row-level question: one row goes in, one value comes out ($36.00, straight off the table). "What is the average revenue per region?" is a group-level question: all 12 rows go in, and only one row per region comes out. You cannot answer a group-level question by pointing at any single row. You need the split-apply-combine move, which databases call GROUP BY and pandas calls groupby.

How this playground stays honest: the 12 transactions below are a fixed dataset where every revenue equals units times a constant unit price (Coffee $4.50, Tea $3.50). Every group total, mean, count, and pivot cell on this page is computed live from those rows in your browser. Nothing is precomputed or faked.

1. The split-apply-combine machine

Pick a grouping column and watch the rows take that column's colors. Split the table into buckets, choose an aggregate, then combine each bucket into a single summary row. Your mission: run a full split and combine for region, then switch the grouping column to product and watch the same rows regroup live.

Group by
Aggregate
Of column
12 raw rows, colored by region
idregionproductunitsrevenue
1NorthCoffee4$18.00
2NorthTea2$7.00
3SouthCoffee6$27.00
4EastTea5$17.50
5SouthTea3$10.50
6EastCoffee2$9.00
7NorthCoffee8$36.00
8SouthCoffee3$13.50
9EastTea1$3.50
10NorthTea6$21.00
11SouthTea4$14.00
12NorthCoffee5$22.50

Progress: you have combined by nothing yet. Run the split and combine for both region and product.

How to choose the grouping column and the aggregate

The grouping column is hiding in the question itself: it is the word after "per" or "each". Revenue per region groups by region. Transactions per product groups by product. The aggregate is the verb: total means sum, how many means count, average means mean, best or worst means max or min.

Two aggregates deserve extra care. Count ignores the value column entirely, so counting revenue and counting units give the same answer. And a mean throws away group size: North's mean revenue comes from 5 rows while East's comes from 3, so treat means of small groups with suspicion.

2. Two-level grouping: the pivot table

One grouping column answers "per region". Two grouping columns answer "per region, per product": split first by region, then split each region bucket again by product. Laid out as a grid, with one grouping on the rows and the other on the columns, this is exactly a pivot table.

3. Translate the question into a recipe

This is the skill you will actually use: turning a plain-language question into a grouping column plus an aggregate. Pick both for each question below. Your answer is computed from the 12 transactions and compared against the correct recipe's table, so a wrong recipe shows you exactly which different question you just answered.

Q1. "What is the total revenue per region?"

Group by
Measure

Q2. "How many transactions did each product generate?"

Group by
Measure

Q3. "What is the average number of units sold per region?"

Group by
Measure

Solved 0 of 3. Solve at least 2 to complete the guide.

← All GuidesNext Guide →