Pandas - check if a string column in one dataframe contains a pair of strings from another dataframe
This question is based on another question I asked, where I didn't cover the problem entirely: Pandas - check if a string column contains a pair of strings This is a modified version of the question. I have two dataframes : df1 = pd.DataFrame({'consumption':['squirrel ate apple', 'monkey likes apple', 'monkey banana gets', 'badger gets banana', 'giraffe eats grass', 'badger apple loves', 'elephant is huge', 'elephant eats banana tree', 'squirrel digs in grass']}) df2 = pd.DataFrame({'food':['apple', 'apple', 'banana', 'banana'], 'creature':['squirrel', 'badger', 'monkey', 'elephant']}) The