I have a pandas DataFrame as follows:
a b
0 1 3
1 2 4
I have a dictionary whose keys are tuples of the pandas DataFrame columns e.g.
{(1, 3) : 5, (2, 4) : 6}
I want to a create a new column in the pandas DataFrame e.g. df['c'] based on this mapping. What is the best way to do this?
So the final DataFrame should be:
a b c
0 1 3 5
1 2 4 6