minor fixes in ml2/3_4

dveni-patch-1
Oscar Araque 5 years ago
parent b3239cbbab
commit 0aa095b40d

@ -478,9 +478,7 @@
"outputs": [],
"source": [
"# Now we make that the plot shows both values combined, and change the labels\n",
"df.query('Age < 20 and Survived == 1').groupby(['Sex','Pclass']).size().unstack(['Sex']).plot(kind='bar', \\\n",
" \n",
" stacked=True) "
"df.query('Age < 20 and Survived == 1').groupby(['Sex','Pclass']).size().unstack(['Sex']).plot(kind='bar', stacked=True) "
]
},
{
@ -493,6 +491,7 @@
"\n",
"pclass_labels = ['First', 'Second', 'Third']\n",
"sex_labels = {'Female': 0, 'Male': 1}\n",
"sex_labels = ['Female', 'Male']\n",
"\n",
"plt = df.query('Age < 20 and Survived == 1').groupby(['Sex','Pclass']).size().unstack(['Sex']).plot(kind='bar', \n",
" stacked=True, rot=0, subplots=False, figsize=(5,10))\n",
@ -511,6 +510,7 @@
"#The same horizontal\n",
"pclass_labels = ['First', 'Second', 'Third']\n",
"sex_labels = {'Female': 0, 'Male': 1}\n",
"sex_labels = ['Female', 'Male']\n",
"\n",
"plt = df.query('Age > 25 and Survived == 1').groupby(['Sex','Pclass']).size().unstack(['Sex']).plot(kind='barh', \n",
" stacked=True, rot=0, subplots=False)\n",

Loading…
Cancel
Save