I want to check if three values exists in a dataframe, I am not sure how to put those value in a proper way.
my code will give me a wrong answer plug a future warning.elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
details = {
'Name' : ['Tom', 'Lee', 'Sara',
'Shivangi', 'Priya', 'Swapnil'],
'University' : ['BHU', 'JNU', 'DU', 'BHU', 'Geu', 'Geu'],
}
df = pd.DataFrame(details, columns = ['Name', 'University'])
if ['Tom', 'Lee', 'Sara'] in df.values:
print("\nYes, These values exist in Dataframe")
else:
print("\nNo,value not exists ")
since dataframe contain 'Tom', 'Lee', 'Sara', the answer should be yes.
