Pandas – DataFrame object is not callable

It is called boolean indexing and need [] only:

df[df.Sex=='male']

Or:

df.query("Sex =='male'")

Leave a Comment