About this question
Given a list of strings L1 L1 = ['a', 'b', 'c'], I need to extract the rows which contain the values given in list L1. I used the isin function: df[df['column1'].isin(L1)]
The data contains the following values in a column 1:
'a'
'c'
'a, d'
'brp'
The data contains the following values in a column 2:
['a']
['c']
['a', 'd']
['brp']
The output I need should print all the rows because the string 'a' is present in L1, but, the output returns only 3 rows: rows 1, 2 (that is the rows containing strings 'a', 'c')
How do I modify the code so that it returns the 3rd row as well?