liveBook · Manning

Plot.box

As explained in Pandas Workout: 200 exercises to make you a stronger data analyst

plot.box is a pandas plotting method that creates box plots from Series or DataFrame data.

Use plot.box to turn a Series or DataFrame’s numeric distribution into a compact box plot. It makes the five-number summary visible: minimum, first quartile, median, third quartile, and maximum. section 11.4

A single Series

Start with s = Series([10, 15, 17, 20, 25]) and call s.plot.box(). The box marks the 25th percentile, median, and 75th percentile; whiskers extend to the minimum and maximum. With values such as -20 and 40 added, circles identify outliers beyond 1.5 times the interquartile range. section 11.4

How Pandas Workout: 200 exercises to make you a stronger data analyst covers it

How deep it goes
Explains box components, whiskers, and outlier calculation, then works through Series, date slices, multiple columns, and grouped plots.
Examples
Demonstrates Series values, Chicago temperatures by month, and minimum or maximum temperatures compared across Chicago, Los Angeles, and Boston.
What it assumes
Assumes familiarity with Series, DataFrame selection, date-index slicing, and basic descriptive statistics.
What you can do after
Apply it via pandas to create single, multi-column, subplot, and grouped box plots from selected numeric data.
How it connects
Connects box plots to descriptive statistics, quantiles, interquartile range, DataFrame selection, date indexes, grouping, and machine-learning preprocessing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pandas Workout: 200 exercises to make you a stronger data analyst. The section links point to the parts of the book it draws on.