Statistics
The `statistics` module provides mathematical statistics functions: mean, median, mode, variance, standard deviation, and linear regression. The guide walks through Central Tendency, Variance & Deviation, Correlation & Regression. `statistics.mean(data)` arithmetic average. `statistics.median(data)` middle value (averages two middle for even length). `statistics.median_low(data)` and `statistics.median_high(data)` always return an actual data point. `statistics.mode(data)` most common value. `statistics.multimode(data)` returns a list of all modes (Python 3.8+). `statistics.pvariance(data)` population variance. `statistics.variance(data)` sample variance (n-1). `statistics.pstdev(data)` population standard deviation. `statistics.stdev(data)` sample standard deviation. Standard deviation is in the same units as the data. Use sample functions when your data is a sample of a larger population. `statistics.correlation(x, y)` Pearson r (-1 to 1). `statistics.linear_regression(x, y)` returns slope and intercept. Predict: `reg.slope * new_x + reg.intercept`. These help analyze relationships between datasets and make predictions based on linear trends. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code.