I understand how to filter a dataframe in pandas using a single or two partial strings:
final_df = df[df['Answers'].str.contains("not in","not on")]
I got the help from this link: Select by partial string from a pandas DataFrame
However I am unable to extend the filtering to more than two partial strings.
final_df = df[df['Answers'].str.contains("not in","not on","not have")]
If I try, I get the following error:
TypeError: unsupported operand type(s) for &: 'str' and 'int'
How do I tweak if I have to extend the filtering based on multiple partial strings? Thank You.