Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

compute the average age for each gender? *

In [10]: titanic.groupby("Sex")["Age"].mean()
Out[10]: 
Sex
female    27.915709
male      30.726645
Name: Age, dtype: float64
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #compute #average #age
ADD COMMENT
Topic
Name
3+6 =