I have a column of data that looks like this:
import pandas as pd
import numpy as np
Items
0 Product A + Product B + Product C
1 Product A + Product B + Product B1 + Product C1
2
I would like to look through the items and find out if the column contains a few specific items, relating to products I am interested in flagging as containing within the items column :
My_Items = ['Product B', 'Product C', 'Product C1']
I've tried the following lambda function but it is not picking up the strings i'm searching if there is more than 1 product within the column:
df['My Items'] = df['Items'].apply(lambda x: 'Contains my items' if x in My_Items else '')
Does anyone know how can search for multiple strings in a list within a lambda function?
Thank you for any help or suggestions.
Kind regards