I need to filter from a dataframe if search item in found in column (e.g. identifying all employees-empID with the searched expertise area
import pandas as pd
date=[
[123,['abc','def','efg']],
[124,['abc','qwe','mno']],
[124,['abc','qwe','mno']],
[126,['wer','abc']]
]
expertise_df=pd.DataFrame(date,columns=['EmpId','areas'])
I am looking to filter for rows that have 'abc' or 'qwe' etc- but without explicitly creating loops across all rows and checking for match. I tried the expertise_df['areas'.str.contains but that doesn't return results. This will be matching around 1000 search strings on 200,000 rows in the expertise_df and hence looking for time-efficient approaches. The brute-force approach takes over 4 hours and not practical
Also, if I need to create union operations (contains either 'abc' or 'pqr' etc)- is there a way the results could be handled as sets to enable this?