I have a sample dataframe like:
cid pos
0 11 29
1 22 29
2 22 29
3 33 29
4 44 29
And now a list of tuple like:
[(11, 3), (22, 1), (33, 4), (44, 4), (55, 7), (66, 2)]
I want to create another column from the list of tuple (2nd element). Only if the first element matches in the df column cid:
Like:
cid pos new_pos
0 11 29 3
1 22 29 1
2 22 29 1
3 33 29 4
4 44 29 4
beginner here with pandas, any help would be great! thank you
