I'm trying to search for a keyword in a dataframe and print the keyyword if found using the following code:
if df[df['description'].str.contains(keyword,case=False)]:
print(keyword)
else:
print("NOT FOUND")
I'm getting the following error message:
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Any suggestions on how to fix this?
.any(). Usually it's better for the OP to change there code, but here...