I have a pandas data frame with the following format:
col1 col2 ... col4
A 2 [2-3-4]
B 3 [2-6]
A 3 [2-3-4]
C 2 [2-3-4]
D 2 [2-3-4]
I would like to select only the rows where the value in col2 is in the list of col4.
I tried to use:
df[(df["col2"].isin(df["col4"].str.split("-"))]
but I get an empty data frame...