Check if string is in a pandas dataframe

前端 未结 7 2043
北荒
北荒 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:06

    You should check the value of your line of code like adding checking length of it.

    if(len(a['Names'].str.contains('Mel'))>0):
        print("Name Present")
    

提交回复
热议问题