How it works...

  • plt.boxplot() is the method to plot a boxplot. The data argument can be a list of one or more attributes. The yellow line in each box represents the median value of the attribute by default (it can be changed to mean too). The bottom whisker is at 1.5 IQR from the bottom line of the box, the upper whisker is at 1.5 IQR above the upper line of the box. The bottom line of the box is at the first quartile, and the upper line of the box is at the third quartile of the data.
  • Points above and below whiskers are outliers. In the first and second box plots, there are no outliers below the bottom whisker, whereas all three of them have outliers above the upper whisker: