Plotting categorical data

In this section, we'll learn about the various categorical plots supported by seaborn and how to draw them. We will demonstrate how to draw plots including a scatterplot, swarmplots, box plots, bar plots, and more. We'll also learn how to draw wide-form categorical plots.

Let's start by importing our pandas module in our Jupyter Notebook with the following code:

import pandas as pdfrom matplotlib import pyplot as plt%matplotlib inlineimport seaborn as sns

Along with pandas, we also need to import the Matplotlib and seaborn Python libraries. We then read in our CSV dataset, as follows:

df = pd.read_csv('data_simpsons_episodes.csv')df.head()

Our dataset in this section is for the famous animated TV series, The Simpsons ...

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.