bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/Python/Files, Modules, and the Standard Library
Python•Files, Modules, and the Standard Library

Python statistics Module

Python has a built-in module that you can use to calculate mathematical statistics of numeric data.

The statistics module was new in Python 3.4.

Statistics Methods

MethodDescription
statistics.harmonic_mean()Calculates the harmonic mean (central location) of the given data
statistics.mean()Calculates the mean (average) of the given data
statistics.median()Calculates the median (middle value) of the given data
statistics.median_grouped()Calculates the median of grouped continuous data
statistics.median_high()Calculates the high median of the given data
statistics.median_low()Calculates the low median of the given data
statistics.mode()Calculates the mode (central tendency) of the given numeric or nominal data
statistics.pstdev()Calculates the standard deviation from an entire population
statistics.stdev()Calculates the standard deviation from a sample of data
statistics.pvariance()Calculates the variance of an entire population
statistics.variance()Calculates the variance from a sample of data

Previous

Python Delete File

Next

Python math Module

This chapter

Overview
13

Lessons

39m

Read time

1. Python File Open2. Python Python Built-in Modules3. How to Remove Duplicates From a Python List4. Python File Open5. Python Random Module6. How to Reverse a String in Python7. Python File Write8. Python Requests Module9. How to Add Two Numbers in Python10. Python Delete File11. Python statistics Module12. Python math Module13. Python cmath Module