Why a single number never tells the whole story
Two doctors measure the same blood pressure readings and report different averages, and both are right. One averaged every reading; the other dropped an obvious sensor glitch first. Descriptive statistics is the discipline of summarising a dataset honestly, and honesty here means knowing which summary your data can support. A mean is not wrong because it is large, and a median is not right because it is tidy â each answers a slightly different question, and picking the wrong one quietly changes the conclusion you draw.
Before any model is fitted, descriptive work answers the questions that decide the rest of the analysis. Are there missing or impossible values? Is one variable an order of magnitude larger than the rest? Is the distribution symmetric, or does it trail off to the right the way incomes and latencies usually do? Is a particular observation an outlier or a genuine extreme? Every preprocessing step that follows â scaling, trimming, transforming, choosing a model family â is really a response to these descriptive findings.
Three questions: where, how wide, what shape
Every distribution summary decomposes into the same three answers. Location asks where the bulk of the data sits, and it is answered by measures of centre. Dispersion asks how spread out the values are, answered by variance, standard deviation, interquartile range, and their relatives. Shape asks about asymmetry and tail weight, answered by skewness and kurtosis. Reporting only the first is the most common reporting error in dashboards, because two datasets with identical means can look completely different once you plot them.
The table below is the working cheat sheet. The right-hand column matters more than the formula column: the moment your data is skewed, heavy-tailed, or measured on a ratio scale with a meaningful zero, the default choice changes.
| Question | Measure | Formula | Sensitive to outliers | Best used when |
|---|---|---|---|---|
| Typical value | Mean | sum of values divided by count | Yes | Symmetric data with no extremes |
| Typical value | Median | middle value once sorted | No | Skewed data or known glitches |
| Most common value | Mode | highest frequency | No | Categorical or discrete data |
| Multiplicative average | Geometric mean | nth root of the product | Moderate | Growth rates and ratios |
| Average of rates | Harmonic mean | count divided by sum of reciprocals | Moderate | Speeds, prices, F1 scores |
| Overall spread | Standard deviation | square root of variance | Yes | Symmetric data |
| Middle spread | Interquartile range | third quartile minus first | No | Any shape |
| Typical deviation | Median absolute deviation | median of absolute deviations | No | Any shape, robust scaling |
Choosing a measure of centre
The arithmetic mean has one property that no other centre shares: it is the point that minimises the sum of squared deviations. That is exactly why least-squares regression and mean-squared error are built on it, and why the mean is the natural centre for any loss function that squares errors. Its weakness is the same fact â squaring gives extreme values outsized influence. A single corrupted reading of 1500 in a list of purchases around 20 pulls the mean from 20 to 230, while the median stays at 20.
The median instead minimises the sum of absolute deviations, which makes it robust rather than efficient. Half the data lies below it by construction, so it survives contamination that wrecks the mean. When the mean sits visibly above the median, the distribution has a right tail pulling the average up; incomes, response times, and file sizes all behave this way. The mode is the only centre that works for unordered categories, and it is also the only one that can be absent or non-unique for continuous data.
Two specialised means handle cases where arithmetic averaging is simply the wrong operation. The geometric mean is the correct average for compounding growth: four quarterly growth rates of ten, twenty, twenty, and thirty percent compound to an overall figure whose quarterly equivalent is the geometric mean, not the arithmetic one. The harmonic mean is the correct average when the quantity being averaged sits in a denominator â average speed over equal distances, or the F1 score, which is the harmonic mean of precision and recall. For any positive dataset the three obey the chain harmonic, no greater than geometric, no greater than arithmetic, with equality only when every value matches.
Spread you can defend
Variance measures the average squared distance from the centre, and the sample version divides by the count minus one rather than the count. That correction, Bessel's correction, exists because the deviations are measured from the sample mean rather than the true mean, and using the sample mean makes the squared deviations systematically too small. Standard deviation returns the measure to the original units of the data, which is why it is the spread you quote in reports.
For roughly normal data, the empirical rule converts standard deviation into intuition: about sixty-eight percent of observations fall within one standard deviation of the mean, ninety-five percent within two, and ninety-nine point seven percent within three. Outside the normal case, reach for measures that do not depend on squared deviations. The interquartile range covers the middle half of the data and drives the standard boxplot fence rule, where any value below the first quartile minus one point five times the interquartile range, or above the third quartile plus the same amount, is flagged as a potential outlier. The median absolute deviation is the robust counterpart to standard deviation, and multiplying it by one point four eight two six makes it a consistent estimator of sigma for normal data.
Shape, tails, and what they imply
Skewness cubes standardised deviations, so values far from the mean dominate the sign. A positive skew means a long right tail and a mean above the median; a negative skew means the mirror image. Kurtosis raises deviations to the fourth power, making it extremely sensitive to rare extremes. Excess kurtosis subtracts three so that the normal distribution sits at zero; positive excess indicates heavier tails and a sharper peak than a normal, which in practice means more surprise values than your model expects.
Shape matters because it selects the model and the preprocessing. Strong right skew usually argues for a logarithmic transform before any method assuming symmetry. High excess kurtosis invalidates intervals derived from the normal approximation and pushes you toward Student's t, robust methods, or explicit tail modelling. Two datasets can share a mean and standard deviation and still require completely different analyses once their shape is known.
Computing and auditing summaries in Python
import numpy as np
def summarize(values):
x = np.asarray(values, dtype=float)
q1, q3 = np.percentile(x, [25, 75])
iqr = q3 - q1
mad = np.median(np.abs(x - np.median(x)))
return {
"n": x.size,
"mean": x.mean(),
"median": np.median(x),
"std_ddof1": x.std(ddof=1),
"iqr": iqr,
"mad": mad,
"skew": float(np.mean(((x - x.mean()) / x.std(ddof=1)) ** 3)),
"excess_kurtosis": float(np.mean(((x - x.mean()) / x.std(ddof=1)) ** 4) - 3),
"outliers": x[(x < q1 - 1.5 * iqr) | (x > q3 + 1.5 * iqr)],
}
purchases = np.array([12, 15, 18, 20, 22, 25, 1500], dtype=float)
report = summarize(purchases)
print(f"mean={report['mean']:.1f} median={report['median']:.1f}")
print(f"outliers={report['outliers']}")
Running that block shows the mean at 230 and the median at 20, with 1500 sitting beyond the upper fence. The summary function also reports both spread measures so you can see how much the standard deviation inflates relative to the interquartile range when contamination is present.
A second block demonstrates the mean hierarchy and the reason to pick deliberately rather than by habit.
def geometric_mean(x):
x = np.asarray(x, dtype=float)
return np.exp(np.mean(np.log(x)))
def harmonic_mean(x):
x = np.asarray(x, dtype=float)
return x.size / np.sum(1.0 / x)
growth = np.array([1.10, 1.20, 1.20, 1.30]) # quarterly growth factors
speeds = np.array([50.0, 100.0]) # km/h out and back
print("arithmetic mean of growth:", growth.mean() - 1)
print("geometric mean of growth :", geometric_mean(growth) - 1)
print("arithmetic mean of speeds:", speeds.mean())
print("harmonic mean of speeds :", harmonic_mean(speeds))
print("check H <= G <= A:",
harmonic_mean(growth) <= geometric_mean(growth) <= growth.mean())
The geometric mean correctly reports the compound growth rate, and the harmonic mean correctly reports the average speed for a round trip: sixty-six point seven rather than seventy-five. The final assertion verifies the inequality that relates all three.
Mistakes that make summaries lie
Common Mistakes
Quoting the mean for heavily skewed data
Fix: Report the median and the interquartile range, or transform the data first and say so.
Using the standard deviation as a spread on outlier-prone data
Fix: Compare it with the interquartile range or median absolute deviation; a large gap signals contamination.
Dividing variance by n instead of n minus one
Fix: Use the sample variance with n minus one so the estimator is unbiased for the population variance.
Averaging percentages or rates directly
Fix: Use the geometric mean for growth rates and the harmonic mean for rates defined as a ratio.
Interpreting kurtosis as a measure of peak height
Fix: Read excess kurtosis as tail weight: positive means more probability in the tails than a normal.
Scaling features without checking shape first
Fix: Inspect skewness and kurtosis; standard scaling does nothing useful for a badly skewed distribution.
Best Practices
- Always report centre and spread together â a mean without a standard deviation is uninterpretable.
- Publish the five-number summary alongside any average for exploratory analysis.
- Check the mean-median gap as a one-line skewness diagnostic before modelling.
- Use robust scaling when the interquartile range is far from the standard deviation.
- Plot the distribution; numeric summaries hide multimodality that changes the analysis entirely.
Descriptive statistics in one page
Where to go next
- Measures of Central Tendency works through mean, median, and mode with Python.
- Skewness and Kurtosis cover shape measures in depth.
- Range and IQR develops quartiles, fences, and boxplots.
- Percentiles and Quartiles explains quantile definitions and interpolation choices.