Check if string is in a pandas dataframe

前端 未结 7 2017
北荒
北荒 2020-11-28 06:38

I would like to see if a particular string exists in a particular column within my dataframe.

I\'m getting the error

ValueError: The truth v

相关标签:
7条回答
  • 2020-11-28 07:11

    I bumped into the same problem, I used:

    if "Mel" in a["Names"].values:
        print("Yep")
    

    But this solution may be slower since internally pandas create a list from a Series.

    0 讨论(0)
提交回复
热议问题