I have a Dataframe that look like this (small version):
A B C
0 125 ADB [AF:12]
1 189 ACB [AF:78, AF:85, AF:98]
2 148 ADB []
3 789 ARF [AF:89, AF:85, AF:12]
4 789 BCD [AF:76, AF:25]
How can I see if some of the items in column "C" are in a list?
knowing that when I do type(df.C) I get class 'pandas.core.series.Series'
if for example the list is:
['AF:12', 'AF25']
The expected output would be:
A B C D
0 125 ADB [AF:12] True
1 189 ACB [AF:78, AF:85, AF:98] False
2 148 ADB [] False
3 789 ARF [AF:89, AF:85, AF:12] True
4 789 BCD [AF:76, AF:25] True
I have tried df['D'] = df['C'].isin(list)
but get False everywhere probably because "C" is a list of list.
Is there a way to get around that?
Any help would be greatly appreciated
df['C']? trytype(df['C'][0]).