I have a dataframe with a column of products that are extremely inconsistent with extra words than are necessary. I would like to check each cell and see if there are words present based on two lists that contain the necessary keywords. I would like to check first if any of the words from the first list are present, if true, I would like to check if any of the words from the second list are present. If both end up being true, I would like to assign a value for that row in column product_clean. If false, the value remains nan.
list1: ['fruit', 'FRUIT', 'Fruit', 'FRUit']
list2: ['banana', 'strawberry', 'cherry']
df:
product product_clean
fruit 10% banana SPECIAL nan
FRUit strawberry 99OFF nan
milk nan
jam nan
cherry FRUIT Virginia nan
df_DESIRED:
product product_clean
fruit 10% banana SPECIAL Fruit
FRUit strawberry 99OFF Fruit
milk nan
jam nan
cherry FRUIT Virginia Fruit