1

I' have 2 tables on pandas (Table1,Table2) and I would like to get a third one (Table3) as in the example below (I feel like a visual example is worth 1000 words)

Could you please tell me how would the code work?

Table1

ISIN Price
A 1
B 2
C 3
D 4

Table2

ISIN Price2
A 5
D 6
E 7

Table3

ISIN Price Price2
A 1 5
B 2
C 3
D 4 6

Thanks for your help!

Dario Bani
  • 123
  • 6

1 Answers1

0

if you are using pandas dataframes you can use the merge() function

Table3 = Table1.merge(Table2, on='ISIN', how='left')
Patrick
  • 1,189
  • 5
  • 11
  • 19