I have a DataFrame in which one column has lists as entries. For a given given value x I want to get a pd.Series of booleans telling me whether x is in each list. For example, given the DataFrame
index lists
0 []
1 [1, 2]
2 [1]
3 [3, 4]
I want to do something like df.lists.contains(1) and get back False, True, True, False.
I am aware I can do this with a Python loop or comprehension, but I would ideally like a Pandas solution analogous to df.mod, df.isin etc.