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.
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 import MongoClient import matplotlib as mpl import matplotlib.pyplot as plt
Next, connect to MongoDB and run a query specifying the five fields to be retrieved from the MongoDB data:
client = MongoClient('localhost', 27017) db = client.pythonbicookbook...