0

I have two data frame

ID       Derived_ID
1          10
1          15 
1          2
2          12
2          5
2          7
3          9
3          13

dataframe2- is like this

ID  FIRSTSCORE   SECONDSCORE     THIRDSCORE
1     10           10             2
2      3           5             NaN
3.     50          NaN           Nan

so here data frame ID column contains same values but as row they are unique. I want to make a new dataframe from these two

Desired Dataframe
    Derived_ID     FIRST_SCORE      SECOND_SCORE    THIRD_SCORE
    10              10                 10             2
    15              10                 10             2
    2               10                 10             2
    12              3                  5             NaN
    15              3                  5             NaN
    7               3                  5             NaN
    9               50                 NaN           NaN
    13              50                 NaN           NaN

so both data frame ID column elements are common. primarily I had plan to make set operation but cant established the idea properly i think panda has better option to make it faster which i dont know yet. Kindly Help me to get this new dataframe thank you :)

Kalyan
  • 1,626
  • 6
  • 30
  • 51

0 Answers0