From 08dfe5c147cb566e3cb7d83b504c911e3fb82094 Mon Sep 17 00:00:00 2001 From: "Carlos A. Iglesias" Date: Thu, 22 Feb 2024 11:55:35 +0100 Subject: [PATCH] Update 3_4_Visualisation_Pandas.ipynb Updated code to last version of seaborn --- ml2/3_4_Visualisation_Pandas.ipynb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ml2/3_4_Visualisation_Pandas.ipynb b/ml2/3_4_Visualisation_Pandas.ipynb index 846dc34..db3eefa 100644 --- a/ml2/3_4_Visualisation_Pandas.ipynb +++ b/ml2/3_4_Visualisation_Pandas.ipynb @@ -220,7 +220,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Analise distributon\n", + "# Analise distribution\n", "df.hist(figsize=(10,10))\n", "plt.show()" ] @@ -233,7 +233,7 @@ "source": [ "# We can see the pairwise correlation between variables. A value near 0 means low correlation\n", "# while a value near -1 or 1 indicates strong correlation.\n", - "df.corr()" + "df.corr(numeric_only = True)" ] }, { @@ -249,11 +249,10 @@ "metadata": {}, "outputs": [], "source": [ - "# General description of relationship betweek variables uwing Seaborn PairGrid\n", + "# General description of relationship between variables uwing Seaborn PairGrid\n", "# We use df_clean, since the null values of df would gives us an error, you can check it.\n", "g = sns.PairGrid(df_clean, hue=\"Survived\")\n", - "g.map_diag(plt.hist)\n", - "g.map_offdiag(plt.scatter)\n", + "g.map(sns.scatterplot)\n", "g.add_legend()" ] },