13.9. Seaborn#

Seaborn is a higher-level library built on top of Matplotlib. It’s specifically designed for creating more visually appealing and informative statistical graphics with less code. It’s excellent for exploring relationships between variables.

Seaborn also requires Matplotlib as a dependency.

import seaborn as sns 
import pandas as pd 
import matplotlib.pyplot as plt 
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import seaborn as sns 
      2 import pandas as pd 
      3 import matplotlib.pyplot as plt 

ModuleNotFoundError: No module named 'seaborn'

13.9.1. Loading Sample Datasets#

Seaborn comes with several built-in datasets that are useful for practice and examples.

# load the Iris dataset 
iris = sns.load_dataset('iris') 
iris
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[2], line 2
      1 # load the Iris dataset 
----> 2 iris = sns.load_dataset('iris') 
      3 iris

NameError: name 'sns' is not defined
iris.head()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 iris.head()

NameError: name 'iris' is not defined