mirror of
https://github.com/gsi-upm/sitc
synced 2024-11-21 22:12:30 +00:00
Update 3_3_Data_Munging_with_Pandas.ipynb
Se utiliza np.size en la última columna. Esto calcula el tamaño de la serie, creo que de valores no null, pero no lo que pienso que se pretende es calcular el número de supervivientes, para lo que se podría utilizar np.sum.
This commit is contained in:
parent
2c8238f1f2
commit
344e054ba4
@ -437,7 +437,7 @@
|
||||
"\n",
|
||||
"#Show mean Age, mean SibSp, and number of passengers older than 25 that survived, grouped by Passenger Class and Sex\n",
|
||||
"df[(df.Age > 25 & (df.Survived == 1))].groupby(['Pclass', 'Sex'])['Age','SibSp','Survived'].agg({'Age': np.mean, \n",
|
||||
" 'SibSp': np.mean, 'Survived': np.size})"
|
||||
" 'SibSp': np.mean, 'Survived': np.sum})"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user