1
0
mirror of https://github.com/gsi-upm/sitc synced 2024-11-17 20:12:28 +00:00

Update 3_4_Visualisation_Pandas.ipynb

Updated code to last version of seaborn
This commit is contained in:
Carlos A. Iglesias 2024-02-22 11:55:35 +01:00 committed by GitHub
parent 78e62af098
commit 08dfe5c147
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()"
]
},