August 2019
Beginner
482 pages
12h 56m
English
We had experience working with matplotlib already—first, in Chapter 3, Functions, and later, in Chapter 8, Simulation with Classes and Inheritance. Luckily, pandas has a built-in interface for working with matplotlib, making visualization very easy and intuitive. But first, we need to prepare the Notebook to display charts:
%matplotlib inlineimport pylab as pltplt.style.use('fivethirtyeight')
Now, let's plot the histogram of total casualties. It's possible to do that with the matplotlib itself—but pandas has a simple interface built-in. For better or worse, we still have to set labels and titles via a standard matplotlib interface—in this case, as follows:
data.loc[~mask, 'killed ...