0

Task Description

I am wanting to merge df1 with df2 to make df3. I just have x, y, z in df1 to symbolise some columns of data. I believe you could use map here to merge the data across so df1 has id2, but I am not entirely sure how to do this. Any help would be super

df1

         id       date      x    y    z
0      12480010 1983-01-03          
1      12484510 1983-01-03     
2      12640810 1983-01-03    
3      12705510 1983-01-03    
4      12769510 1983-01-03  
5      12480010 1983-02-03          
6      12484510 1983-02-03     
7      12640810 1983-02-03    
8      12705510 1983-02-03    
9      12769510 1983-02-03

df2

         id          id2
0      12480010   124800101      
1      12484510   124845105
2      12640810   126408101 
3      12705510   127055102
4      12769510   127695102

Desired df3

         id       date      x    y    z    id2
0      12480010 1983-01-03               124800101
1      12484510 1983-01-03               124845105
2      12640810 1983-01-03               126408101
3      12705510 1983-01-03               127055102
4      12769510 1983-01-03               127695102
5      12480010 1983-02-03               124800101
6      12484510 1983-02-03               124845105
7      12640810 1983-02-03               126408101
8      12705510 1983-02-03               127055102
9      12769510 1983-02-03               127695102
oceanbeach96
  • 604
  • 9
  • 19

0 Answers0