Creating a customized box plot with whiskers

Box plots help to identify the outliers in data, and are useful for comparing distributions. As per Wikipedia, Box and whisker plots are uniform in their use of the box: the bottom and top of the box are always the first and third quartiles, and the band inside the box is always the second quartile (the median).

The lines extending from the box are the whiskers. Any data not included between the whiskers is an outlier.

How to do it…

  1. To create a customized box plot with whiskers, begin by importing all the required libraries. To show the matplotlib plots in IPython Notebook, we will use an IPython magic function which starts with %:
    %matplotlib inline import pandas as pd import numpy as np from pymongo ...

Get Python Business Intelligence Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.