statistics
— Mathematical statistics functions
Documentation: https://docs.python.org/3/library/statistics.html
This module provides functions for calculating mathematical statistics of numeric data.
Averages and measures of central location
Method |
Description |
mean() |
Arithmetic mean (“average”) of data.} |
fmean() |
Fast, floating point arithmetic mean. |
cgeometric_mean() |
Geometric mean of data. |
harmonic_mean() |
Harmonic mean of data. |
median() |
Median (middle value) of data. |
median_low() |
Low median of data. |
median_high() |
High median of data. |
median_grouped() |
Median, or 50th percentile, of grouped data. |
mode() |
Single mode (most common value) of discrete or nominal data. |
multimode() |
List of modes (most common values) of discrete or nominal data. |
quantiles() |
Divide data into intervals with equal probability. |
Measures of spread
Method |
Description |
pstdev() |
Population standard deviation of data. |
pvariance() |
Population variance of data. |
stdev() |
Sample standard deviation of data. |
variance() |
Sample variance of data. |
Method |
Description |
covariance() |
Sample covariance for two variables. |
correlation() |
Pearson’s correlation coefficient for two variables. |
linear_regression() |
Slope and intercept for simple linear regression. |