Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

compute the average age for each gender? *

In [51]: df.groupby('Gender', as_index=False).Age.mean()
Out[51]:
   Gender  Age
0  Female   18
1    Male   15
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compute #average #age
ADD COMMENT
Topic
Name
4+8 =