-2

I am trying to convert fallowing SQL statement into pandas dataframe in python

SELECT sum(money) from df where sex='female'

I am unable to get this in pandas

Thanks in advance

Manoj Kalluri
  • 1,384
  • 2
  • 14
  • 27

1 Answers1

1

df.loc[df.sex=='female','money'].sum()

Jay
  • 193
  • 7