Our first plot with seaborn

In this section, we will create a distribution plot using just one variable, as follows:

sns.distplot(df.beer_servings)

Here, sns refers to seaborn, which we imported earlier as sns. We now need to call the method of seaborn as distplot and pass in the column name from the data we read earlier. This should give us a nice distribution plot with a single line of code, as shown in the following screenshot:

This single line demonstrates the power and simplicity of the seaborn library.

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.