*567*

The statistics module provides functions to mathematical statistics of numeric data. there are a variety of useful functions are available

The statistics module was introduced in Python 3.4, so if you are using an older version of python you will have to install a newer one if you want to use these.

Lets look at the functions that are available

## Averages and measures of central location

These functions calculate an average or typical value from a population or sample.

`mean()` |
Calculates the Arithmetic mean (“average”) of data. |

`fmean()` |
Calculates the Fast, floating point arithmetic mean. |

`geometric_mean()` |
Calculates the Geometric mean of data. |

`harmonic_mean()` |
Calculates the Harmonic mean of data. |

`median()` |
Calculates the Median (middle value) of data. |

`median_low()` |
Calculates the Low median of data. |

`median_high()` |
Calculates the High median of data. |

`median_grouped()` |
Calculates the Median, or 50th percentile, of grouped data. |

`mode()` |
Calculates the Single mode (most common value) of discrete or nominal data. |

`multimode()` |
Calculates the List of modes (most common values) of discrete or nomimal data. |

`quantiles()` |
Divide data into intervals with equal probability. |

## Measures of spread

These functions calculate a measure of how much the population or sample tends to deviate from the typical or average values.

`pstdev()` |
Calculates the Population standard deviation of data. |

`pvariance()` |
Calculates the Population variance of data. |

`stdev()` |
Calculates the Sample standard deviation of data. |

`variance()` |
Calculates the Sample variance of data. |

### Code

This example shows some of the more common function sin action

import statistics list_example = [4,6,7,2,6,5,5,5,5,2,5,6,1,4,2] a = statistics.mean(list_example) print(a) b = statistics.median(list_example) print(b) c = statistics.mode(list_example) print(c) d = statistics.stdev(list_example) print(d) e = statistics.variance(list_example) print(e)