Hi I have a df like the following:
Col1 Col2
SM_ SM_
SM_ N_
EX_,SM_ EX_,CO_
SL_,N_ PD_,SL_
I want to compare both columns, and see if a value in Col1 is present in Col2 or not. Multiple values in both columns are comma separated. So, ideally the result of the row wise comparison shown above should be:
True
False
True
True
I have the following code right now:
finaldf['C'] = finaldf.apply(lambda x: x.Extracted_pillars in x.min_pillar_score, axis=1)
This works for single code values, but when each column has multiple values, this does not work properly.