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 pd
from matplotlib import pyplot as plt
%matplotlib inline
import 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:

The preceding dataset includes release dates, viewership numbers, ratings, and a bunch of other observations for each  The Simpsons episode.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.199.131