Skip to content
Start free

More returns, or returned more often?

An AI blames the big warehouse for returns. Compare the two warehouses by rate, with each denominator named.

2 parts · 6 and 3 min

Free course. Your Maestro, an AI, .

Operations asked: "Which warehouse has a returns problem?" The AI grouped the shipping table by warehouse, added up the returns, saw 6 for East and 3 for West, and answered: "East has twice the returns, focus there."

The arithmetic is right—6 is twice 3—yet the conclusion points Operations at the wrong building. A raw count of returns measures two things mixed together: how often orders come back, and how many orders the warehouse shipped in the first place. A busy warehouse will rack up more returned boxes than a quiet one even when its packing is cleaner.

From counts to rates per group

In the orders table below, one row is one shipped order, and returned is True when the order came back and False when it stayed with the customer. To compare warehouses of different sizes in , you need three numbers for each group:

  1. The numerator (returned orders per warehouse): orders.groupby("warehouse")["returned"].sum() adds up True as 1 and False as 0 inside each warehouse.
  2. The denominator (shipped orders per warehouse): orders.groupby("warehouse").size() counts every row in each group, whether returned is True or False. If you are unsure why .size() and .sum() return different numbers on the same group, ask your Maestro.
  3. The return rate per warehouse: orders.groupby("warehouse")["returned"].mean() takes the of the 0 and 1 values inside each group, which divides each warehouse's returns by that same warehouse's shipped orders.

Be careful not to divide each warehouse's returns by len(orders), the 50 orders across the whole company. Dividing 6 by 50 (12%) and 3 by 50 (6%) uses a shared denominator, which only rescales the raw counts and keeps the 2-to-1 gap unchanged. To see how often a warehouse's orders come back, each warehouse needs its own shipped orders in the denominator.

Try it

Add how many orders each warehouse shipped and each return rate, then compare the two warehouses with both denominators named.

Your turn

Run the AI's code. Add the number of orders per warehouse and the return rate per warehouse. You're done when you can say which warehouse's orders came back more often, out of how many.

A good place to stop. Up next: What the rates and denominators tell Operations · 3 min

What the rates and denominators tell Operations

Running .size() and .mean() alongside .sum() lays out the full picture:

  • East: 6 returned out of 40 shipped orders, a return rate of 0.15 (15%).
  • West: 3 returned out of 10 shipped orders, a return rate of 0.30 (30%).

Once you divide by each warehouse's shipped orders, the AI's conclusion reverses. West's orders came back twice as often as East's (30% versus 15%). East only had more returned boxes because it shipped four times as many orders.

Naming the denominators in your answer does a second job: it keeps you from overclaiming on a small group. Saying "West has a 30% return rate" sounds just as solid as "East has a 15% return rate." Writing "30% (3 of 10 orders) versus 15% (6 of 40 orders)" shows the reader that West's rate rests on only 10 shipments, where a single order moves the rate by 10 percentage points. If you want feedback on how you phrased your comparison sentence, share your draft with your Maestro.

That shapes the decision Operations should make: instead of launching a big audit in East or overhauling West's floor based on 10 shipments, pull the 3 returned orders from West and inspect what went wrong with them.

Common mistake: A rate without its denominator hides how much data backs it

Reporting "West: 30%, East: 15%" fixes the raw-count mistake but hides that West shipped only 10 orders. Pair every rate with its numerator and denominator—"30% (3 of 10 orders)" and "15% (6 of 40 orders)"—so anyone reading your summary sees both the rate and the volume behind it.

Check yourself: You need to put one sentence in the Operations update comparing East (40 orders, 6 returned) and West (10 orders, 3 returned). Which sentence gives a sound comparison and next step?