Надеюсь, это поможет:
#creating a dummy dataframe
df=pandas.DataFrame(numpy.array([[1,0,0,0,1,1,0,1,0,1],[1,1,0,0,0,1,1,0,1,1],[0,0,1,1,1,0,0,1,0,0]]).transpose(),columns=['Winner','Sex_female','Sex_male'])
Output:
Winner Sex_female Sex_male
0 1 1 0
1 0 1 0
2 0 0 1
3 0 0 1
4 1 0 1
5 1 1 0
6 0 1 0
7 1 0 1
8 0 1 0
9 1 1 0
#Find the number of females who survived and how many did not
df[df['Sex_female']==1]['Winner'].value_counts()
Output:
1 3
0 3
Вместо df[df['Sex_female']==1]['Winner'].mean()
даст процент выживших женщин