Quantiles and Robust Summaries
Ask what fraction lies below
A quantile is a boundary below which a chosen fraction of observations falls. The 50th percentile is the median; p95 is the value at or below which 95% of observations lie. The interquartile range (IQR) spans the 25th to 75th percentiles, describing the middle half without being dominated by extremes.
s = df['latency_ms']
print(s.quantile([0.5, 0.9, 0.95, 0.99]))
print('IQR', s.quantile(0.75) - s.quantile(0.25))
Percentiles answer operational questions averages cannot: p99 latency describes a threshold exceeded by the slowest 1% of requests. But an estimated tail percentile needs enough observations; p99 from only 50 rows is mostly one noisy data point.
Warning: p95 does not mean 95% of requests took exactly that long. It means 95% were at or below that boundary, while 5% were slower.
Note: Robust statistics are resistant to a modest number of extreme values, not immune to bad sampling. A stable median from the wrong population is still misleading.