From 344e054ba40d923993b1957d07a8853ebc27c6e3 Mon Sep 17 00:00:00 2001 From: Dani Vera Date: Wed, 18 Sep 2019 15:39:16 +0200 Subject: [PATCH] Update 3_3_Data_Munging_with_Pandas.ipynb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- ml2/3_3_Data_Munging_with_Pandas.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml2/3_3_Data_Munging_with_Pandas.ipynb b/ml2/3_3_Data_Munging_with_Pandas.ipynb index 4cf7079..16ee2b1 100644 --- a/ml2/3_3_Data_Munging_with_Pandas.ipynb +++ b/ml2/3_3_Data_Munging_with_Pandas.ipynb @@ -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})" ] }, {