Module 8: Analyses employers ask for · Lesson 8.3 · about 15 min
Pareto and ABC analysis
Find the few products that make most of the revenue: sort, take a cumulative share, label A, B and C classes with cut, and draw the Pareto curve that stock planners and category managers use.
Module 8 · about 15 minutes · uses Lessons 4.1 and 4.5. You’ll be able to rank items by contribution and split them into A, B and C classes.
In everyday terms: a wardrobe: you wear a handful of favourite clothes most days. Those few deserve the front of the rail; the rest can go further back.
1. Cumulative share
Read down the cum_% column: the top product alone is about 12 % of revenue, the top 10 together about 61 %.
2. A, B and C classes
- A: the items that make the first 80 %. Never let them run out; review them weekly.
- B: the next 15 %. Normal care.
- C: the last 5 %, often many items. Candidates for a smaller range or ordering less often.
3. The Pareto curve
The curve rises fast and then flattens. The more it bows towards the top left, the more concentrated sales are. A straight diagonal would mean every product sells the same.
- sort_values(ascending=False)
- Biggest contributors first.
- cumsum() / sum()
- Cumulative share: how much the top items make together.
- A / B / C
- Up to 80 %, 80-95 %, the rest (common cut-offs; pick your own).
- Shift the share by one
- So the item that crosses 80 % still counts as A.
- Physical meaning
- The cumulative share curve rises steeply and then flattens. Its steepness says how concentrated the business is: 20 % of items making 80 % is a common pattern, not a law.
“It is always 80/20.” Concentration varies: in the course shop, 17 of 32 products make 80 %. Measure it; do not assume it.
Watch it happen, one step at a time:
| product | revenue |
|---|---|
| P1 | 50 |
| P2 | 25 |
| P3 | 15 |
| P4 | 6 |
| P5 | 4 |
| product | cum % | class |
|---|---|---|
| P1 | 50 | A |
| P2 | 75 | A |
| P3 | 90 | A |
| P4 | 96 | B |
| P5 | 100 | C |
4. Your turn
How it works
Principle: sort the items from biggest to smallest and plot the running share of the total against the share of items. That is the Pareto curve (a Lorenz curve drawn the other way up):
The bigger the gap between the curve and the diagonal, the more concentrated the total. Economists turn that gap into the Gini coefficient. The 80/20 shape shows up in many places (sales, customers, defects, web pages) because a few causes often build on themselves, but always measure it; never assume it.
5. Practice
- ABC by units instead of revenue. Do the classes change?
- Do the same for customers: what share of customers makes 80 % of revenue?
- Why might a C product still be worth keeping?
Answers
- Replace revenue with qty. Cheap items move up, expensive ones down, so yes, some change class.
- Group by
customer_id, then the same steps; count the A customers and divide by the number of customers. - It may bring people in (a loss leader), complete a basket (batteries with a gadget), or have a high margin.
New words: Pareto principle, cumulative share, ABC analysis, Lorenz curve, concentration.
- Sort by contribution, then cumsum ÷ sum.
- Classify on the share before each item, so the crossing item is A.
- Cut-offs like 80/95 are choices; state them.
- Measure concentration; do not assume 80/20.
Check yourself
Sources
- Juran, J. M. (1951), Quality Control Handbook, McGraw-Hill (the Pareto principle)
- McKinney, W. (2022), Python for Data Analysis, 3rd edition, O'Reilly (open access) https://wesmckinney.com/book/
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. All datasets are made up. Python runs in your browser (the first run downloads it once, about 20 MB); nothing you type is sent anywhere.