18 Worked example - Creating a box plot (even number of data points)#

%%html
<iframe width="700" height="400" src="https://www.youtube.com/embed/oajrmwCALmc/" frameborder="0" allowfullscreen></iframe>
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt

khanacademy

Worked example - Creating a box plot (even number of data points) fig 1

x = Series([5,2,10,2,6,8,8,1,2,5,7,3,3,4])
x.plot(kind='box')
<AxesSubplot:>
../_images/18 Worked example - Creating a box plot (even number of data points)_6_1.png
plt.boxplot(x)
plt.axes().set_yticks(range(15))
[<matplotlib.axis.YTick at 0x7f036fed1040>,
 <matplotlib.axis.YTick at 0x7f036fec9a00>,
 <matplotlib.axis.YTick at 0x7f036fec3a30>,
 <matplotlib.axis.YTick at 0x7f036fef3af0>,
 <matplotlib.axis.YTick at 0x7f036fefd280>,
 <matplotlib.axis.YTick at 0x7f036fefd9d0>,
 <matplotlib.axis.YTick at 0x7f036fe85160>,
 <matplotlib.axis.YTick at 0x7f036fe858b0>,
 <matplotlib.axis.YTick at 0x7f036fe85b20>,
 <matplotlib.axis.YTick at 0x7f036fefdca0>,
 <matplotlib.axis.YTick at 0x7f036fe880d0>,
 <matplotlib.axis.YTick at 0x7f036fe88700>,
 <matplotlib.axis.YTick at 0x7f036fe88e50>,
 <matplotlib.axis.YTick at 0x7f036fe925e0>,
 <matplotlib.axis.YTick at 0x7f036fe92d30>]
../_images/18 Worked example - Creating a box plot (even number of data points)_7_1.png
# TODO: refactor and remove this warning