Numerical Standard Library Modules
statistics — standard library module
Descriptive statistics, paired-data analysis, kernel density estimation and normal distributions. Choose sample versus population measures deliberately; handle missing and NaN values before analysis. This module is not a complete statistical modeling toolkit.
Formal Syntax & Structure
python syntaxpython
import statisticsReturn Value
Not applicable
Import binds a module name; individual APIs determine results.
Working Example
Example Snippetpython
import statisticsprint(statistics.mean([2, 4, 6]), statistics.stdev([2, 4, 6]))