CommencerCommencer gratuitement

Building a PairGrid

When exploring a dataset, one of the earliest tasks is exploring the relationship between pairs of variables. This step is normally a precursor to additional investigation.

Seaborn supports this pair-wise analysis using the PairGrid. In this exercise, we will look at the Car Insurance Premium data we analyzed in Chapter 1. All data is available in the df variable.

Cet exercice fait partie du cours

Intermediate Data Visualization with Seaborn

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create a PairGrid with a scatter plot for fatal_collisions and premiums
g = sns.___(df, ___=["fatal_collisions", "premiums"])
g2 = g.___(sns.scatterplot)

plt.show()
plt.clf()
Modifier et exécuter le code