Skip to content
Hands-on Mentor
ENTR
Back to blog

Mean, median, mode: what they are and when to use each

The mean, median and mode are three ways to find the center of data. See one extreme value move the mean, and learn when the median is the more honest choice.

4 min read

The mean is the sum of all values divided by how many there are. The median is the middle value when you sort the data. The mode is the value that appears most often. All three describe a "typical" value, but they react differently to extreme values and to different kinds of data, so the one you pick can change your conclusion.

Mean, median, mode examples: seven orders

Bazaar is a fictional online store. These are the amounts of seven completed orders from one day, February 15, 2026 (in dollars):

164.95, 12.45, 59.80, 34.95, 359.96, 14.95, 29.80

The largest order, $359.96, is a robot vacuum. The others are small. Let's compute all three.

import pandas as pd

amount = pd.Series([164.95, 12.45, 59.80, 34.95, 359.96, 14.95, 29.80])
print(round(amount.mean(), 2))
print(amount.median())
print(amount.mode().tolist())
96.69
34.95
[12.45, 14.95, 29.8, 34.95, 59.8, 164.95, 359.96]
  • Mean: $96.69. Add all seven amounts and divide by 7. Only two orders are above this number.
  • Median: $34.95. Sort the values and take the 4th of 7. Half of the orders are at or below it.
  • Mode: no useful answer. No amount repeats, so pandas returns every value. The mode is rarely helpful for continuous numbers like money.

If you remove the biggest order, the mean falls from $96.69 to $52.82. One value moved it by $43.87. The median barely cares about that order: it would stay $34.95 even if the purchase were $3,599.60.

With an even number of values, the median is the average of the two middle values. For 10, 20, 30, 40 it is 25.

When should you use the median instead of the mean?

Use the median when a few very large or very small values would pull the mean away from what most cases look like. Income, house prices and order amounts are typical examples. Here "the average customer spends $96.69" would be misleading, because almost nobody spent close to that amount.

Use the mean when values are fairly symmetric, or when you care about totals. Mean times count gives the total, which is what a budget needs. The mean order of $96.69 times 7 gives the day's revenue of $676.86. The median times 7 gives $244.65, far too low.

print(round(amount.sum(), 2), round(amount.median() * 7, 2))
676.86 244.65

So the answer depends on the question. "What does a typical customer spend?" calls for the median. "How much revenue should I expect?" calls for the mean.

How do the mean and median compare on skewed data?

The gap between them is a clue about the shape of the data:

  • Mean much larger than the median: a few large values stretch the data to the right (right-skewed).
  • Mean much smaller than the median: a few small values stretch it to the left (left-skewed).
  • Mean close to the median: the data is probably roughly symmetric.

Here the mean ($96.69) is almost three times the median ($34.95), which signals a strong right skew. It is a hint, not proof. Plot a histogram to confirm. Reporting both numbers is often more informative than reporting one.

What is the mode good for?

The mode is the main tool for categorical data: values like device, city or product category that have no order. You cannot average "mobile" and "desktop", but you can ask which one is most common. Across Bazaar's 787 completed orders, 456 came from mobile and 331 from desktop:

device = pd.Series(["mobile"] * 456 + ["desktop"] * 331)
print(device.mode().tolist())
print(device.value_counts().to_dict())
['mobile']
{'mobile': 456, 'desktop': 331}

mode() returns a list because several values can tie for most common.

Quick comparison

SituationBest measureWhy
Symmetric values, no extremesMeanUses every value
A few very large or small valuesMedianNot moved by extremes
Unordered categoriesModeThe only one you can compute
Planning totalsMeanMean times count equals the total

Common mistakes

  • Reporting only the mean for skewed data. It overstates the typical value.
  • Finding the median without sorting. Sort first.
  • Averaging categories. Coding cities as 1, 2, 3 and taking the mean has no meaning.
  • Deleting an extreme value without checking it. The $359.96 order could be a typo or a real purchase. Learn how to decide in [how to find outliers with the IQR method](/blog/outliers-iqr-method).

What to read next

In the lesson [Mean, median and mode](/learn/statistics-data-analysis/mean-median-mode) you compute all three on the full Bazaar orders. After the center comes the spread, which is explained in [standard deviation explained](/blog/standard-deviation-explained). The full path is on the [Statistics and Data Analysis course page](/courses/statistics-data-analysis).

  • #statistics
  • #mean
  • #median
  • #mode
All posts