I have a Dataframe with two columns A and B (df1)
A B
1 2
1 3
2 3
And a Dataframe (df2) with a "dictionary" describing 1, 2 and 3
O P Q
1 s a
2 s b
3 t b
Now I want to merge the first table with the second table such that I get the following:
A B P1 Q1 P2 Q2
1 2 s a s b
1 3 s a t b
2 3 s b t b
I've tried df1.merge(df2, left_on=["A","B"], right_on=["O","O"])