I have a DataFrame as below
df = pd.DataFrame({
'x' : range(0,5),
'y' : [[0,2],[3,4],[2,3],[3,4],[7,9]]
})
I would like to test for each row of x, if the value is in the list specified by column y
df[df.x.isin(df.y)]
so I would end up with:
Not sure why isin() does not work in this case