From df6449b55fe4e57038c019f79e5c95e960393c69 Mon Sep 17 00:00:00 2001 From: cif Date: Mon, 7 Mar 2022 12:57:17 +0100 Subject: [PATCH] Updated to last version of seaborn --- ml2/3_4_Visualisation_Pandas.ipynb | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/ml2/3_4_Visualisation_Pandas.ipynb b/ml2/3_4_Visualisation_Pandas.ipynb index e802a5d..846dc34 100644 --- a/ml2/3_4_Visualisation_Pandas.ipynb +++ b/ml2/3_4_Visualisation_Pandas.ipynb @@ -367,7 +367,7 @@ "outputs": [], "source": [ "# Now we visualise age and survived to see if there is some relationship\n", - "sns.FacetGrid(df, hue=\"Survived\", size=5).map(sns.kdeplot, \"Age\").add_legend()" + "sns.FacetGrid(df, hue=\"Survived\", height=5).map(sns.kdeplot, \"Age\").add_legend()" ] }, { @@ -567,7 +567,7 @@ "outputs": [], "source": [ "# Plot with seaborn\n", - "sns.countplot('Sex', data=df)" + "sns.countplot(x='Sex', data=df)" ] }, { @@ -683,16 +683,6 @@ "df.groupby('Pclass').size()" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Distribution\n", - "sns.countplot('Pclass', data=df)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -725,7 +715,7 @@ "metadata": {}, "outputs": [], "source": [ - "sns.factorplot('Pclass',data=df,hue='Sex',kind='count')" + "sns.catplot(x='Pclass',data=df,hue='Sex',kind='count')" ] }, { @@ -906,7 +896,7 @@ "outputs": [], "source": [ "# Distribution\n", - "sns.countplot('Embarked', data=df)" + "sns.countplot(x='Embarked', data=df)" ] }, { @@ -997,7 +987,7 @@ "outputs": [], "source": [ "# Distribution\n", - "sns.countplot('SibSp', data=df)" + "sns.countplot(x='SibSp', data=df)" ] }, { @@ -1180,7 +1170,7 @@ "outputs": [], "source": [ "# Distribution\n", - "sns.countplot('Parch', data=df)" + "sns.countplot(x='Parch', data=df)" ] }, { @@ -1233,7 +1223,7 @@ "metadata": {}, "outputs": [], "source": [ - "df.groupby(['Pclass', 'Sex', 'Parch'])['Parch', 'SibSp', 'Survived'].agg({'Parch': np.size, 'SibSp': np.mean, 'Survived': np.mean})" + "df.groupby(['Pclass', 'Sex', 'Parch'])[['Parch', 'SibSp', 'Survived']].agg({'Parch': np.size, 'SibSp': np.mean, 'Survived': np.mean})" ] }, { @@ -1576,7 +1566,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1590,7 +1580,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.1" + "version": "3.8.12" }, "latex_envs": { "LaTeX_envs_menu_present": true,