Statistics
Beginner 13 min read Statistics

Descriptive Statistics

Summarizing data without losing the plot

Descriptive statistics summarize a sample: central tendency (mean, median, mode), dispersion (variance, standard deviation, IQR) and shape. They are the grammar of every chart and the foundation of inference.

meanmedianstandard deviationIQRvariancedistributionoutliers
Before we start

What you will learn

  • Use the right measure of central tendency for a distribution
  • Describe dispersion with variance, SD and IQR
  • Detect skew and outliers from these summaries
Introduction

What is this?

Descriptive statistics compress a dataset into a handful of numbers that capture where it sits and how it spreads: mean vs median for center, variance and standard deviation for typical distance from the mean, quartiles and IQR for robust spread, and shape statistics (skew) for asymmetry. Any single number hides the distribution — the discipline is choosing which numbers tell the truth for this shape.

Motivation

Why do you need it?

  • A mean without context (spread, shape) actively misleads decision-makers.
  • Skewed data breaks the mean: one billionaire makes a village 'average' misleading.
  • SD is the unit you need before significance tests, effect sizes and CIs.
  • IQR cleanly separates outliers from the core where the mean cannot.
Think about it

Mental model

Imagine

Describing a photo to someone who can't see it

Think of

Descriptive statistics

You can say both subjects are 'about 6 feet' (mean) — but description needs more: one is in a wheelchair and one on a ladder. Center and spread are the honest description of the picture.

Mechanics

How it works

  • Mean = sum/n, sensitive to every value including outliers; median = middle position, robust.
  • Variance = mean squared deviation; SD = its square root, expressed in the data's units.
  • Quartiles split sorted data into fourths; IQR = Q3 − Q1, the robust middle 50%.
  • Skew measure tells which tail is longer; distributions with outliers show mean pulled past median.
  • The five-number summary (min, Q1, med, Q3, max) proves a boxplot.

Center, spread and shape in a single lens.

Data
Center
Spread
Shape
Summary
Hands-on

Examples

Python one-liners for the classic summaries

Python one-liners for the classic summaries
import pandas as pd, numpy as np
df = pd.DataFrame({"rev": [10, 12, 11, 13, 12, 14, 220]})
print("mean:", df["rev"].mean()) # 41.7 — pulled by the outlier
print("median:", df["rev"].median()) # 12 — honest center
print("sd:", df["rev"].std().round(2)) # 78.9 — inflated by the outlier
print("iqr:", df["rev"].quantile(.75) - df["rev"].quantile(.25)) # 1.5

One outlier demolishes the mean and SD but leaves median and IQR stable — which is exactly why robust summaries exist.

Real world

In production

  • Pricing teams report median order value plus IQR when a few luxury orders skew averages.
  • Ops teams set p90 latency targets from percentiles, not raw means.
  • Compensation analysis compares medians by group to survive executive outliers.
Guidelines

Best practices

  • Always pair center with spread: mean+SD or median+IQR.
  • Report median and IQR for skewed data; mean+SD for roughly symmetric data.
  • State the n — a sample of 5 cannot carry an executive story.
  • Visualize the histogram alongside the numbers; the shape tells what the summary hides.
Watch out

Common mistakes

  • Quoting an opinionated mean for skewed distributions.
  • Comparing means without comparing spreads (10 vs 11 means, SD 1 vs 40).
  • Ignoring n, so a 6-row table drives a strategy.
  • Using SD when IQR better describes a heavy-tailed set (or vice versa).
When things break

Debugging tips

  • If mean ≠ median by a lot, expect skew — check the histogram before any claim.
  • SD larger than the mean is a sign of a right-skewed or exponential-like distribution.
  • One row that bonks everything? Re-run summaries with it excluded to measure influence.
  • Zero variance in a group (SD=0) will break t-tests — check for it.
Interviews

Interview checkpoint

Practice

Hands-on lab

Summarize a Sales Sample Honestly
25 min · beginner
In progress
Objectives
  • Compute mean, median, SD and IQR on a real sample
  • Show how one outlier changes each summary
  • Write a one-paragraph honest summary of the data

Summarize a Sales Sample Honestly

25 min · beginner

0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

For a distribution skewed right by outliers, which pair best describes it?

2

Standard deviation is measured in the same units as the original data.

Go deeper

Official documentation