The Mode
The most common.
The third average is the mode. It's simply the most common value. It's the only average that works for categories, like the most popular colour, or the most common shoe size.

- The most common value
- Works for categories
- Popular colour, common size
Counting to find the mode
A shop sold these shoe sizes today. Counter from the collections module counts each value, and most common gives the winner. Run it. Size eight sold three times, so eight is the mode. It also works on words, like colours.
from collections import Counter
sizes = [7, 8, 8, 9, 8, 10, 7]
print(Counter(sizes).most_common(1))
colours = ["red", "blue", "red", "green", "blue", "red"]
print(Counter(colours).most_common(1))[(8, 3)]
[('red', 3)]Three averages
Here's a summary. The mean is best for symmetric numbers, without extreme values. The median is best when there are outliers, or a long tail, like incomes or house prices. And the mode is for categories, or for the most common value. Reporting more than one often tells a richer story.
| Average | How | Best for |
|---|---|---|
| Mean | sum ÷ count | symmetric data |
| Median | middle value | outliers, skewed data |
| Mode | most common | categories |
Summary
The mode is the most common value, and it works for categories too. Next, a closer look at when the mean and the median disagree.
Key takeaways- Counter(...).most_common
- Works for words
- Three averages