Let's have this DataFrame
d = {'col1': [[0,1], [0,2], [1,2], [2,3]], 'col2': ["a", "b", "c", "d"]}
df = pandas.DataFrame(data=d)
col1 col2
0 [0, 1] a
1 [0, 2] b
2 [1, 2] c
3 [2, 3] d
Now I need to find a particular list in col1 and return the value from col2 of that line
For example I want to lookup [0,2] and get "b" in return
I have read this thread about how to do it: extract column value based on another column pandas dataframe
But when I try to apply the answers there, I don't get the result I need
df.loc[df['col1'] == [0,2], 'col2']
ValueError: Arrays were different lengths: 4 vs 2
df.query('col1==[0,2]')
SystemError: <built-in method view of numpy.ndarray object at 0x000000000D67FA80> returned a result with an error set