Introduction to Seaborn

Introduzione alla visualizzazione dei dati con Seaborn

Content Team

DataCamp

What is Seaborn?

  • Python data visualization library
  • Easily create the most common types of plots

Box plots of total bill for each day of the week, factored by male vs. female

1 Waskom, M. L. (2021). seaborn: statistical data visualization. https://seaborn.pydata.org/
Introduzione alla visualizzazione dei dati con Seaborn

Why is Seaborn useful?

Picture of a data analysis workflow

Introduzione alla visualizzazione dei dati con Seaborn

Advantages of Seaborn

  • Easy to use
  • Works well with pandas data structures
  • Built on top of matplotlib
Introduzione alla visualizzazione dei dati con Seaborn

Getting started

import seaborn as sns

import matplotlib.pyplot as plt

Samuel Norman Seaborn (sns)

  • "The West Wing" television show
Introduzione alla visualizzazione dei dati con Seaborn

Example 1: Scatter plot

import seaborn as sns
import matplotlib.pyplot as plt

height = [62, 64, 69, 75, 66, 68, 65, 71, 76, 73] weight = [120, 136, 148, 175, 137, 165, 154, 172, 200, 187]
sns.scatterplot(x=height, y=weight)
plt.show()

Scatter plot of height vs. weight

Introduzione alla visualizzazione dei dati con Seaborn

Example 2: Create a count plot

import seaborn as sns
import matplotlib.pyplot as plt

gender = ["Female", "Female", "Female", "Female", "Male", "Male", "Male", "Male", "Male", "Male"]
sns.countplot(x=gender)
plt.show()

Count plot of gender

Introduzione alla visualizzazione dei dati con Seaborn

Scatter plot with black and red hue colors

Line plot with markers and solid lines

Point plot of masculinity with hue

Scatter plot of horsepower vs. mpg with sequential palette

1 Waskom, M. L. (2021). seaborn: statistical data visualization. https://seaborn.pydata.org/
Introduzione alla visualizzazione dei dati con Seaborn

Let's practice!

Introduzione alla visualizzazione dei dati con Seaborn

Preparing Video For Download...