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
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
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us