Reputation: 8855
I have a Pandas dataframe where one of the columns stores lists of string literals. For example, my data looks like the following.
field1, field2
x1, ['tag1', 'tag2']
x2, ['tag1', 'tag3']
I want to get only the records in this dataframe whose field2
list contains tag1
or tag2
. So, in the example above, only the record where field1=x1
should be returned.
How can I do this filtering on a Pandas dataframe?
Upvotes: 0
Views: 47