I am looking to find if two different strings are present in a row of a dataframe.
For example, I currently have this code which provides answers with item a OR b.
items=('a|b')
df1 = train[train['antecedents'].str.contains(items,flags=re.IGNORECASE, regex=True)]
As helpful as this is, I am looking to find all rows that have item a AND b.
Because I can't use multiple str.contains (as the number of items aren't specified until inputted into the items variable), I don't know how to incorporate the '&' into str.contains (I've tried and it doesn't work).
Is there possibly a different way to incorporate the '&' ?