I have a dataframe with combinations between occurencers in two columns:
A B
0 a z
1 a y
2 b z
3 c z
4 c y
5 c x
And a matrix in a different dataframe with the values got from the combination of all possible values of A and B:
x y z
a 0.5 0.3 0.2
b 0.3 0.9 0.1
c 0.6 0.8 0.7
I would like to get their interseption in a new column of the main dataframe, searching the pair of values in this table and getting the correspondent interseption from the other dataframe. Example:
A B C
0 a z 0.2
1 a y 0.3
2 b z 0.1
3 c z 0.7
4 c y 0.8
5 c x 0.6
Can anyone please help?