Pandas - data frame object is not callable.(python 2)

前端 未结 1 801
逝去的感伤
逝去的感伤 2021-01-16 17:48

I have the following code:

df(df.Sex==\'male\')

I get an error stating that the dataframe object is not callable.

How can I solve t

相关标签:
1条回答
  • 2021-01-16 18:27

    It is called boolean indexing and need [] only:

    df[df.Sex=='male']
    

    Or:

    df.query("Sex =='male'")
    
    0 讨论(0)
提交回复
热议问题