mirror of
https://github.com/gsi-upm/sitc
synced 2024-12-22 11:48:12 +00:00
Update 3_4_Visualisation_Pandas.ipynb
Updated code to last version of seaborn
This commit is contained in:
parent
78e62af098
commit
08dfe5c147
@ -220,7 +220,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# Analise distributon\n",
|
"# Analise distribution\n",
|
||||||
"df.hist(figsize=(10,10))\n",
|
"df.hist(figsize=(10,10))\n",
|
||||||
"plt.show()"
|
"plt.show()"
|
||||||
]
|
]
|
||||||
@ -233,7 +233,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# We can see the pairwise correlation between variables. A value near 0 means low correlation\n",
|
"# 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",
|
"# while a value near -1 or 1 indicates strong correlation.\n",
|
||||||
"df.corr()"
|
"df.corr(numeric_only = True)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -249,11 +249,10 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"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",
|
"# 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 = sns.PairGrid(df_clean, hue=\"Survived\")\n",
|
||||||
"g.map_diag(plt.hist)\n",
|
"g.map(sns.scatterplot)\n",
|
||||||
"g.map_offdiag(plt.scatter)\n",
|
|
||||||
"g.add_legend()"
|
"g.add_legend()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user