0

Im looking for a way to make multiple merges in pandas, in the way a nested Vlookup would work in excel whenever the data isnt found: Here is the situation. I have 2 excel files, one (T1) with 3 different types of IDS and im looking for a result in another table(T2), which may or may not have all 3 IDs:

T1:

ID1 ID2 ID3
ONE CODE1 1
TWO CODE2 2
THR CODE3 3
FOU CODE4 4
FIV CODE5 5
SIX CODE6 6
SEV CODE7 7
EIG CODE8 8
NIN CODE9 9

T2:

ID1 ID2 ID3 Result
ONE CODE1 1 100
TWO 200
CODE3 300
4 400
FIV CODE5 500
SIX 6 600
SEV CODE7 700

I want to get somethinig like this:

ID1 ID2 ID3 Result
ONE CODE1 1 100
TWO CODE2 2 200
THR CODE3 3 300
FOU CODE4 4 400
FIV CODE5 5 500
SIX CODE6 6 600
SEV CODE7 7 700
EIG CODE8 8 800
NIN CODE9 9 900

Im stuck because when i try to merge, 'Result' gets duplicated Can you help me with the propper way to do it? Thanks!

Cobe
  • 1
  • 1

0 Answers0