Mean or Median?
Outliers pull the mean.
A small company has seven workers, and a boss. The boss says the average salary is over a hundred thousand. The workers say they earn about forty. Who's lying? Pause. Maybe nobody.

- Seven workers and a boss
- Average over 100k?
- Workers earn about 40k
One outlier
Here are the salaries, in thousands. The last one is the boss. Run it. The mean is about a hundred and forty five, but the median is thirty nine. The boss's huge salary drags the mean up. The median tells you what a typical worker earns.
import numpy as np
salaries = np.array([30, 32, 35, 38, 40, 41, 45, 900])
print("mean: ", salaries.mean().round(1))
print("median:", np.median(salaries))mean: 145.1 median: 39.0
Seeing the gap
Real incomes look like this. Most people earn a moderate amount, and a few earn a lot, which makes a long tail on the right. We draw a histogram, then a line for the mean, and one for the median. Run it. The mean sits to the right of the median, pulled by the tail.
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng(0)
income = rng.lognormal(10.5, 0.6, 5000) / 1000
plt.hist(income, bins=60)
plt.axvline(income.mean(), color="#22d3ee", label="mean")
plt.axvline(np.median(income), color="#fbbf24", label="median")
plt.title("Incomes (thousands)"); plt.legend()
plt.savefig("income.png")Summary
Outliers and long tails pull the mean, but not the median. For incomes and prices, report the median. Next, averages where some values count more.
Key takeaways- Outliers pull the mean
- Median for skewed data
- Check both