I have a Pandas DataFrame that stores lists in one of its columns:
>>> import pandas as pd
>>> d = [{'name': 'john', 'properties': ['a','b']},
... {'name': 'mary', 'properties': ['a','c']}]
>>> df = pd.DataFrame(d)
>>> df
name properties
0 john [a, b]
1 mary [a, c]
How can I filter by list membership? For example, list all rows that have a 'c' in their properties column.
I know I could explode the properties column:
df.explode('properties')
but I'd prefer to keep it as a list.