SeeingML
Working With Data Guide 1 of 8 · tap to switch
✦ Interactive Visual Guide 8 min · 4 hands-on labs · Beginner friendly

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.

Interactive Lab 1: Inspect Columns & Rows
Nominal Categorical
Try this: Click any column header to inspect its data type, or click any flat row to see how one complete training example is put together.
Row (Example)
£1,65014.5Rating BHackney
£2,15027.2Rating CCamden
£1,480111.0Rating DGreenwich
£2,68033.1Rating ARichmond
£1,92026.4Rating BHackney
Flat 1:1 bed, 4.5 min walk, Energy Rating B, HackneyRent £1,650/month
Each row is one complete training example: these 4 clues describe the flat, paired with its actual rent so a model can learn what drives the price.
London Borough (Clue 4, Nominal Categorical): Named labels with NO natural order (Hackney is not "greater than" Camden). Never replace unordered names with raw numbers like 1, 2, 3, 4, or a model will invent a fake ranking.

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.

Interactive Lab 2: Drag One Extreme Salary (Mean vs. Median)
9 fixed neighbors (£32k to £56k)10th neighbor (drag dot or slide below)
Gap: +£1k
£50k£100k£150k£200k£250k£300k£350k£400k£450kAnnual Salary of 10 Neighbors on One Street (£k)Median £44.5kMean £45.4k↔ £60k
£60k
When all 10 neighbors earn typical local salaries, Mean (£45.4k) and Median (£44.5k) sit almost right on top of each other. Now grab the amber 10th dot and drag it right toward £450k (or click Executive Moves In)!

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.

Interactive Lab 3: Same 25-Min Average, Totally Different Spread
Both Means: 25.0 min
Shared Mean: 25 minApp A (Steady) · Avg Spread (SD) 1.9m · Middle Half (IQR) 2.7mApp B (Your Slider) · Avg Spread (SD) 10.6m · Middle Half (IQR) 15.3mQ1 (25% mark): 17.4mQ3 (75% mark): 32.6m0m10m20m30m40m50m60mTakeaway Delivery Time (Minutes) · Shaded Box = Middle Half (Q1 to Q3 = IQR)
App A (Steady)
Q1 (25%): 23.6mQ3 (75%): 26.4mMiddle Half (IQR): 2.7mAvg Spread (SD): 1.9m
App B (Your Slider)
Q1 (25%): 17.4mQ3 (75%): 32.6mMiddle Half (IQR): 15.3mAvg Spread (SD): 10.6m
Avg Spread (SD) = 10.6 min
Same exact 25-minute average! Yet App A delivers calmly between 21.8 and 28.2 min (Q1 23.6m to Q3 26.4m, Middle Half IQR 2.7m, Avg Spread SD 1.9m), while App B swings wildly from 7.2 to 42.8 min (Q1 17.4m to Q3 32.6m, Middle Half IQR 15.3m, Avg Spread SD 10.6m).

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.

Interactive Lab 4: Why You Must Always Plot the Histogram
Mean £50.1 · Median £36.0 · SD £31.6
Orders (Count)1532111111Mean (£50.1)Median (£36.0)£20£40£60£80£100£120Customer Spend (£) (All 3 Datasets Average ~50, Radically Different Shapes)
Right-Skewed (Mean £50.1, Median £36.0): Most customers spend £20 to £40, while a handful of big office catering orders pull the Mean far to the right of the Median!

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 x1,…,xnx_1, \dots, x_n:

xˉ=1n∑i=1nxi,s2=1n−1∑i=1n(xi−xˉ)2,s=s2\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i, \qquad s^2 = \frac{1}{n - 1}\sum_{i=1}^{n}(x_i - \bar{x})^2, \qquad s = \sqrt{s^2}

Dividing sample variance by n−1n - 1 instead of nn (Bessel’s correction) produces an unbiased estimator of the true population variance σ2\sigma^2, compensating for the 1 degree of freedom spent estimating xˉ\bar{x} 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 ∞\infty sends both to ∞\infty), skewed or outlier-prone ML features are better summarized with Median (50% breakdown point) and IQR (Q3−Q1Q_3 - Q_1) or Median Absolute Deviation (MAD):

IQR=Q0.75−Q0.25,MAD=median ⁣( ∣xi−median(x)∣ )\text{IQR} = Q_{0.75} - Q_{0.25}, \qquad \text{MAD} = \text{median}\!\left(\,|x_i - \text{median}(x)|\,\right)

3. Sample Skewness (Fisher-Pearson standardized third moment):

g1=1n∑i=1n(xi−xˉ)3s3g_1 = \frac{\frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^3}{s^3}

Values near 00 indicate symmetry; g1>1g_1 > 1 signals strong right skew (long upper tail, where typically Mean>Median\text{Mean} > \text{Median}); g1<−1g_1 < -1 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
python
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

  1. Tag every column type: Separate continuous numbers, discrete counts, ordinal ranks, and nominal names right at the start.
  2. Compare Mean against Median: A big gap immediately warns you about extreme outliers or heavy skew.
  3. Check spread alongside center: Pair Mean with SD on clean bell-shaped columns, and Median with IQR on skewed ones.
  4. 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.
✓ Self-Check

Quick Intuition Check

Four quick real-world scenarios. No scores, just test your intuition.

1

A tech startup has 9 junior engineers earning £45k and 1 founder earning £950k. Which summary best represents a typical employee's pay?

Pick an option first, or peek anytime
2

Which column in a customer table is Nominal Categorical (labels with no natural numeric order)?

Pick an option first, or peek anytime
3

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?

Pick an option first, or peek anytime
4

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.

Pick an option first, or peek anytime
Quick Reference

Common Questions

What is descriptive statistics in plain English?
Descriptive statistics summarizes and describes the key patterns inside a dataset you already collected, using measures of center (mean, median, mode), spread (standard deviation, variance, IQR), and shape (skewness, modality), without trying to generalize beyond the sample.
What is the difference between descriptive and inferential statistics?
Descriptive statistics describes the dataset in front of you (such as the median salary and spread across 500 employees). Inferential statistics uses a sample to make probability-backed predictions or hypothesis tests about a larger unseen population.
When should I use Median instead of Mean?
Use Median whenever your data is skewed or contains extreme outliers, such as household incomes, London rents, or website session lengths. One billionaire pulls the Mean upward for everyone, while the Median stays anchored at the true middle person.
What is the difference between Variance and Standard Deviation?
Variance averages the squared distances from the mean, which puts it in squared units (like minutes squared). Standard Deviation takes the square root of Variance so the spread returns to the exact same everyday units as your data (minutes or pounds).
What does Interquartile Range (IQR) show on a box plot?
IQR is the distance between the 75th percentile (Q3) and the 25th percentile (Q1), showing the width of the middle 50% of your data. Because it ignores the extreme top and bottom quarters, IQR is the outlier-resistant cousin of Standard Deviation.
Why does knowing data types matter before training a machine learning model?
Models treat every input as a number. Feeding nominal labels like borough names as 1, 2, 3 tricks models into inventing fake numeric ordering, whereas ordinal ratings like A, B, C have a real sequence and continuous measurements need scaling.
Why should you always plot a histogram even after computing mean and standard deviation?
Completely different datasets (symmetric, heavily right-skewed, or bimodal with two separate peaks) can share the exact same Mean and Standard Deviation. Plotting the histogram immediately exposes clusters, gaps, and skew.

Written & illustrated by Muhammad Aashir Irshad · Updated December 2026 · Free open-access reference

https://seeingml.com/learn/descriptive-statistics/ Open GitHub issue Suggest an edit
Cite this guide in a paper, thesis, or course (BibTeX & APA)
BibTeX
@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}
}
APA

Irshad, M. A. (2026). Descriptive Statistics: Interactive Visual Guide. SeeingML. https://seeingml.com/learn/descriptive-statistics/