**Online Courses**

- Complete Python Bootcamp: Go from zero to hero in Python
- Complete Python Web Course: Build 8 Python Web Apps

**Statistics with Python**

Using the math library you can get various statistical values. We start by creating a list of values:

0 1 2 3 4 | import math x = [1,2,15,3,6,17,8,16,8,3,10,12,16,12,9] |

**Five number summary**

We can get the five number summary using the math library. The five number summary contains: minimum, maximum, median, mean and the standard deviation.

0 1 2 3 4 5 6 7 8 9 10 11 | import math import numpy x = [1,2,15,3,6,17,8,16,8,3,10,12,16,12,9] print(numpy.min(x)) print(numpy.max(x)) print(numpy.std(x)) print(numpy.mean(x)) print(numpy.median(x)) |

**Boxplot**

This code will create a boxplot:

0 1 2 3 4 5 6 7 8 | import matplotlib.pyplot as plt import numpy as np x = [1,2,15,3,6,17,8,16,8,3,10,12,16,12,9] plt.boxplot(x) plt.show() |

## 6 Comments

I am newbie and I am using windows 32, I got the error below

Traceback (most recent call last):

File “C:/Users/ELTE/Desktop/python/readme.py”, line 2, in

import numpy

ImportError: No module named ‘numpy’

You are missing the module ‘numpy’. http://www.scipy.org/install.html

There are unofficial window binaries for the numpy module: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Excuse me, whats the meaning of the plot? why that shape like a piston?

plot is a module that contains graphical functions. We call boxplot() which creates that particular shape.

Have a look at http://matplotlib.org/ for more graphics

Traceback (most recent call last):

File “/home/andre/test.py”, line 4, in

import matplotlib.pyplot as plt

ImportError: No module named matplotlib.pyplot

>>>

Hi Andre, install the module matplotlib using pip. http://matplotlib.org/