0

I need to filter some information from my data grid, such as average surviving age and proportion of living men and women

I try with this

tit.groupby(by=['Survived'])['Yes']

But I can't filter this way

O.PJ
  • 15
  • 3

1 Answers1

0

You are probably working with the titanic dataset, and for this filter you don't need groupby.

First filter:

tit.loc[tit['Survived'] == 'Yes']

Second filter:

tit.loc[(tit['Survived'] == 'Yes') & (tit['Sex'] == 'Women')]
Erfan
  • 40,971
  • 8
  • 66
  • 78