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.51One 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.
