Python - Statistics Module

The statistics module provides functions to mathematical statistics of numeric data. The following popular statistical functions are defined in this module.

The mean() method calculates the arithmetic mean of the numbers in a list.

>>> import statistics

The median() method returns the middle value of numeric data in a list.

>>> import statistics

The mode() method returns the most common data point in the list.

>>> import statistics

The stdev() method calculates the standard deviation on a given sample in the form of a list.

>>> import statistics

Learn about the statistics module in Python docs.