Data Science ยท Chapter 16 of 43

Descriptive Statistics

Descriptive stats summarise a dataset: MEAN, MEDIAN, MODE (centre); RANGE, VARIANCE, STANDARD DEVIATION (spread); MIN, MAX, QUARTILES.

Always look at both centre and spread โ€” a single number hides a lot.

Example 1 (python)
import numpy as np
x = np.array([5, 7, 8, 9, 10, 12, 100])
print(np.mean(x), np.median(x), np.std(x))
Output
21.57 9.0 32.51

One outlier pulls the mean up.

Example 2 (python)
import pandas as pd
pd.Series(x).describe()
Output
count 7
mean 21.57 ...

.describe() gives a full summary.

Key points

  • Mean = average.
  • Median = middle value (robust to outliers).
  • Std = spread.
  • Always show centre + spread together.
๐Ÿ’ก Note: When mean >> median, your data is skewed โ€” investigate outliers before modelling.

๐Ÿ“ Quick Quiz

1. The middle value of sorted data is the:

2. Standard deviation measures:

3. Which is most robust to outliers?