Describing Data · 20 min
Measures of Centre and Spread
The number that hides the story
In 2023, the average salary at a mid-size tech company was 74,000. Both are true. Neither is wrong. But if you're a new hire asking "what will I earn?", the mean is actively misleading.
This is not a cautionary tale about lying with statistics. It's a demonstration of the most fundamental skill in data analysis: choosing the right summary statistic for the question you're actually asking.
AI tools generate summary statistics instantly. They will give you mean, median, standard deviation, and quartiles in one call. What they won't tell you is which number matters for your specific question — or when the number they've highlighted is the wrong one for your data.
Measures of centre
A measure of centre summarises where your data tends to sit. There are three:
Mean — the arithmetic average. Add all values, divide by count. Sensitive to every data point, including extreme ones.
Median — the middle value when sorted. Half the data is above it, half below. Unaffected by extreme values at either end.
Mode — the most frequent value. Mainly useful for categorical data or discrete counts.
The choice between mean and median is not arbitrary. Use the mean when your data is roughly symmetric and you want a value that accounts for every data point's magnitude. Use the median when your data is skewed or when outliers shouldn't dominate the summary.
import numpy as np
import pandas as pd
salaries = [48000, 52000, 55000, 58000, 61000, 65000, 68000, 72000, 74000, 410000]
print(np.mean(salaries)) # 96300.0
print(np.median(salaries)) # 63000.0
One executive's salary (96,300 — a value that no actual employee earns. The median ($63,000) sits where most people actually are. In right-skewed distributions like income, house prices, and response times, the median is almost always the more informative measure of centre.
Measures of spread
Knowing the centre is not enough. Two datasets can have the same mean with completely different spread — and that spread determines how much you can rely on the centre as a description.
Range — max minus min. Simple but fragile: one extreme value changes it entirely.
Variance — the average squared deviation from the mean. Useful mathematically, but the squared units make it hard to interpret directly.
Standard deviation — the square root of variance. Back in the original units, interpretable as "roughly how far from the mean a typical value sits."
IQR (Interquartile Range) — the distance between the 25th and 75th percentile (Q3 − Q1). Like the median, it ignores the extremes.
data = pd.Series([48000, 52000, 55000, 58000, 61000, 65000, 68000, 72000, 74000, 410000])
print(data.std()) # 111768.3
print(data.quantile(0.75) - data.quantile(0.25)) # 16500.0
print(data.describe())
# count 10.000
# mean 96300.000
# std 111768.300
# min 48000.000
# 25% 53750.000
# 50% 63000.000
# 75% 70250.000
# max 410000.000
The standard deviation (16,500) describes the middle 50% of salaries accurately. Same data, very different picture.
The pairing matters:
- Mean + standard deviation: appropriate for symmetric, roughly normal data
- Median + IQR: appropriate for skewed data or when outliers are present
Using mean + standard deviation on skewed data isn't technically wrong — it's just uninformative.
What describe() gives you and what it doesn't
df = pd.DataFrame({"salary": salaries, "tenure_years": [1, 2, 2, 3, 4, 5, 6, 7, 8, 12]})
print(df.describe())
# salary tenure_years
# count 10 10.00
# mean 96300 5.00
# std 111768 3.37
# min 48000 1.00
# 25% 53750 2.25
# 50% 63000 4.50
# 75% 70250 7.25
# max 410000 12.00
describe() gives you both mean and median (50th percentile), which is deliberate. The gap between them is your first signal about skewness. A large gap — like the $33,300 difference here — tells you to investigate before using the mean for anything important.
Summary: Mean, median, and mode each answer a different question about centre. Standard deviation and IQR each measure spread differently. The correct pairing depends on your data's shape: mean + std for symmetric data, median + IQR for skewed data or data with outliers. The gap between mean and median in describe() output is your first signal that the distribution is skewed and that the mean should be used carefully.
Next: With summary statistics established, the next step is understanding the full shape of your data — not just its centre and spread, but whether it's symmetric, skewed, or bimodal, and what each shape implies for your analysis.
Knowledge check
5 questions · pass with 70% or better