I have a dataframe that has an array as one of its values
Alg iMap_x
0 Max() [12,34]
1 Min() [43,11,84,33]
2 Sum() [93,15,3,99,37]
I want to filter my dataframe based on iMap_x value
I have i = [43,11,84,33]
when i try this code it does not work
df[df["iMap_x"] == i]["Alg"]
this gives error
ValueError: ('Lengths must match to compare', (4,), (2,))
I also tried
df[df["iMap_x"].isin(i)]["Alg"]
but gave no values (empty dataframe)
I tried
df["iMap_x"].isin(i)
but gave all false
0 False
1 False
2 False
3 False
any idea how to do that?
df[df.iMap_x.map(tuple).isin([tuple(i)])]