See if a value exists in a DataFrame

后端 未结 1 1765
渐次进展
渐次进展 2020-12-19 12:21

In Python to check if a value is in a list you can simply do the following:

>>>9 in [1,2,3,6,9]
True

I would like to do the same f

相关标签:
1条回答
  • 2020-12-19 12:57

    Basically you have to check the matrix without the schema, so:

     7 in df.values
    

    x in df checks if x is in the columns:

    for x in df:
        print x,
    
    out: a b c d
    
    0 讨论(0)
提交回复
热议问题