Working With Data Guide 1 of 8 · tap to switch
Descriptive Statistics
How to read any dataset in minutes: data types, mean vs. median, standard deviation, IQR box plots, and why averages alone can mislead.
Before you train any machine learning model, you have to actually understand the table sitting in front of you. Even the cleverest algorithm can be tripped up by a single bizarre value, a lopsided column, or categories mixed up with numbers. Descriptive statistics is the first quick checkup you run on a dataset: finding what is typical, how spread out the values are, and what shape they form before a single model trains.
In spreadsheet-style machine learning, every row is one real-world example (one flat, one customer, one patient) and every column is either a clue (feature) or the answer you want to predict (target). Text columns also split into two kinds: Nominal categories are unordered names (like a London Borough), while Ordinal categories are ranked labels with a real order (like Energy Rating A to G). Click any column header or row in the London flat listings below to inspect how each kind of column works.
| Row (Example) | |||||
|---|---|---|---|---|---|
| £1,650 | 1 | 4.5 | Rating B | Hackney | |
| £2,150 | 2 | 7.2 | Rating C | Camden | |
| £1,480 | 1 | 11.0 | Rating D | Greenwich | |
| £2,680 | 3 | 3.1 | Rating A | Richmond | |
| £1,920 | 2 | 6.4 | Rating B | Hackney |
Spot that crucial distinction early: Nominal categories like London boroughs have no built-in order, while Ordinal categories like Energy Ratings (A > B > C > D) do. Treating unordered names as raw numbers (1, 2, 3) is one of the fastest ways to confuse a model.
Mean vs. Median: Finding the Center in Descriptive Statistics
Once you have a column of numbers, the first question everyone asks is: “What is a typical value?”
The Mean (plain arithmetic average) sums every value and divides by the count. The Median lines everyone up from smallest to largest and picks the middle person.
Grab the glowing amber dot below representing the 10th neighbor on a normal street, and drag their salary from £60k up to £450k to watch Mean and Median react completely differently.
That is why economists report Median household income and housing reports quote Median home price. When one extreme value (an outlier) enters the room, the Mean leaps upward so high that almost nobody on the street actually earns the “average.”
Measuring predictability: Standard Deviation and IQR box plots
Knowing the center is only half the story. Imagine choosing between two takeaway apps that both advertise a 25-minute average delivery time:
- App A arrives between 22 and 28 minutes almost every single evening.
- App B arrives in 8 minutes once, then makes you wait 50 minutes the next time.
To measure spread, statisticians pair each center with a matching ruler:
- Standard Deviation (SD) pairs with the Mean, measuring the typical distance from the average in the exact same units (minutes).
- Interquartile Range (IQR) pairs with the Median. Line all deliveries up from fastest to slowest: Q1 (the 25% mark) is the cutoff where one-quarter of orders are faster, and Q3 (the 75% mark) is where three-quarters of orders are faster. The distance from Q1 to Q3 is the IQR, marking the width of the middle 50% of orders (the shaded box on a box plot, immune to rare extreme delays).
Slide App B’s unpredictability below and watch its box plot stretch from Q1 to Q3 while its 25-minute Mean stays completely frozen.
The summary trap: same Mean, totally different worlds
Even Mean and Standard Deviation together can fool you if you never glance at a chart. The fastest way to inspect a column’s true shape is a histogram: a bar chart showing how often values fall in each bucket (taller bars mean more examples landed in that range). Switch through the three real-world datasets below, all hovering near the same ~50 average, to see why plotting the distribution shape is non-negotiable.
Notice both traps in action: in the Right-Skewed cafe orders (a lopsided curve with a long upper tail), a handful of big catering orders pulls the Mean well above what a typical customer spends. And in the Bimodal (Two Peaks) restaurant rush, almost nobody waits 50 minutes, yet the average lands dead-center in the empty valley between the quick lunch crowd and the slower dinner rush!
See exact formulas, Bessel's correction & skewness definitionsThesis / Reference
1. Sample Mean and Sample Variance (with Bessel’s correction): For observations :
Dividing sample variance by instead of (Bessel’s correction) produces an unbiased estimator of the true population variance , compensating for the 1 degree of freedom spent estimating from the same sample.
2. Robust Location & Scale (Median, IQR, and MAD): Because Mean and SD have a breakdown point of 0% (a single corrupted value sent to sends both to ), skewed or outlier-prone ML features are better summarized with Median (50% breakdown point) and IQR () or Median Absolute Deviation (MAD):
3. Sample Skewness (Fisher-Pearson standardized third moment):
Values near indicate symmetry; signals strong right skew (long upper tail, where typically ); signals strong left skew. As shown famously by Anscombe (1973) and Matejka & Fitzmaurice (2017, Datasaurus Dozen), identical means, standard deviations, and correlations can hide radically different distributions, making visual EDA mandatory.
See fast summary profiling in Python (pandas)Optional Code
import pandas as pd
df = pd.DataFrame({
"rent_gbp": [1650, 2150, 1480, 2680, 1920, 9500],
"rooms": [1, 2, 1, 3, 2, 4],
"borough": ["Hackney", "Camden", "Greenwich", "Richmond", "Hackney", "Mayfair"],
})
# Compare Mean vs Median and SD vs IQR immediately
q1, med, q3 = df["rent_gbp"].quantile([0.25, 0.5, 0.75])
print(f"Mean: £{df['rent_gbp'].mean():.0f} | Median: £{med:.0f}")
print(f"SD: £{df['rent_gbp'].std():.0f} | IQR: £{q3 - q1:.0f}")
print(f"Skew: {df['rent_gbp'].skew():.2f}")Four-step data check before building any model
- Tag every column type: Separate continuous numbers, discrete counts, ordinal ranks, and nominal names right at the start.
- Compare Mean against Median: A big gap immediately warns you about extreme outliers or heavy skew.
- Check spread alongside center: Pair Mean with SD on clean bell-shaped columns, and Median with IQR on skewed ones.
- Always plot the histogram: Next up in Probability Distributions, we explore the recurring shapes real-world data takes, from bell curves and waiting times to the Central Limit Theorem.
Quick Intuition Check
Four quick real-world scenarios. No scores, just test your intuition.
A tech startup has 9 junior engineers earning £45k and 1 founder earning £950k. Which summary best represents a typical employee's pay?
Which column in a customer table is Nominal Categorical (labels with no natural numeric order)?
Two coffee machines both pour an average of 250 ml per cup. Machine A has SD = 4 ml; Machine B has SD = 38 ml. What does that tell you?
If a dataset has a Mean of 50 and Standard Deviation of 15, the values are guaranteed to form a single symmetric bell curve centered at 50.
Common Questions
What is descriptive statistics in plain English?
What is the difference between descriptive and inferential statistics?
When should I use Median instead of Mean?
What is the difference between Variance and Standard Deviation?
What does Interquartile Range (IQR) show on a box plot?
Why does knowing data types matter before training a machine learning model?
Why should you always plot a histogram even after computing mean and standard deviation?
Related Visual Guides
Probability Distributions (Normal, Binomial & CLT)
The recurring shapes behind real-world data: bell curves, click counts, arrival rates, waiting times, and the Central Limit Theorem.
Missing Data and Outliers
How to handle blank spreadsheet cells, catch outliers without falling for the Z-score masking trap, and tell typos apart from real signal.
Feature Scaling: Normalization vs Standardization
Why salary in pounds bullies age in years, how Min-Max, Standardization, and RobustScaler compare under outliers, and which models actually care.
Written & illustrated by Muhammad Aashir Irshad · Updated December 2026 · Free open-access reference
Cite this guide in a paper, thesis, or course (BibTeX & APA)
@misc{irshad2026descriptivestatistics,
author = {Irshad, Muhammad Aashir},
title = {Descriptive Statistics: Interactive Visual Guide},
howpublished = {SeeingML},
year = {2026},
month = {dec},
url = {https://seeingml.com/learn/descriptive-statistics/},
note = {Interactive visual guide}
} Irshad, M. A. (2026). Descriptive Statistics: Interactive Visual Guide. SeeingML. https://seeingml.com/learn/descriptive-statistics/