I have a multi index dataframe which has multiple rows with the same index, it looks like this :
table 1
m_value
LETTER NUMBER
A 1 45487
A 1 7424
A 1 1564
A 1 486421
A 2 7897
A 2 12
A 2 4897
... ... ...
D 4 78978
D 4 12
D 4 27827
And another one, smaller, which has the same multindex but only one association per key :
table 2
divide
LETTER NUMBER
A 1 45
A 2 25
A 3 7
A 4 11
B 1 25
B 2 3
B 3 45
... ... ...
D 2 89
D 3 25
D 4 10
I want to divide the first dataset by the second one, respecting the multindex keys.
I tried this
table_A['result'].div(table_2['divide']).values
but the result is not the one expected, I do not know what happened.
Any better solution to do that?