0

I have 2 data frame as follow:

DF1 has 100,000 row with 2 columns namely user_id & movie_id

DF1
user_id movie_id
0   1   242
1   2   302
2   1   377
3   3   51
4   1   346
... ... ...
100000 rows × 2 columns

DF2 has 943 rows with 2 columns : user_id & gender. total user_id is 943 in DF2 and is the same as user_id appears in DF1 , but in DF1 user_id appears multiple times..

DF2
user_id gender
0   1   M
1   2   F
2   3   M
3   4   M
4   5   F
... ... ...

943 rows × 2 columns

I want to join/merge DF1 & DF2.

the desired result :

user_id movie_id gender
0   1   242        M
1   2   302        F
2   1   377        M   
3   3   51         M
4   1   346        M
... ....

Anyone has any idea? I am fairly new to pandas. Appreciated any advise...

Adamtky
  • 33
  • 4

0 Answers0