Also NOTE: This post doesn't answer my question: Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
I am using str.contains() the following way:
df1['company'] = ""
search = ['Inc.','Company','Ltd','Co.']
if(df1['fu'].str.contains('|'.join(search), na=False)):
df1["company"] = "Yes"
else:
df1['company'] = "No"
While df1['fu'].str.contains('|'.join(searchfor), na=False)
works by itself, (i.e. it prints True/False values), the code written above throws a value error
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
What is confusing is that the df1['fu'].str.contains('|'.join(searchfor), na=False)
does return boolean values.
NOTE: I do not want to use .all() or .any() because I want an element wise Truth/False instead of on the entire set.