0

lets say that I have two Dfs

     DF1                    DF2
     Fruit Colour           Fruit Popular_colour Status
     Apple Red              Apple Green          Ready
     Pear  Green            Apple Red            Ready
     Mango Yellow           Apple Light Green    Not Ready
                            Pear  Yellow         Ready
                            Pear  Green          Ready
                            Pear  Dark Green     Not Ready

How do I replace the values in DF2['Popular_colour'] according to the colour in DF1 where the status in DF2 is ready? Provided that DF1 is distinct?

       Outcome
       DF2
       Fruit Popular_colour Status
       Apple Red            Ready
       Apple Red            Ready
       Apple Light Green    Not Ready
       Pear  Green          Ready
       Pear  Green          Ready
       Pear  Dark Green     Not Ready
Jason Ching Yuk
  • 894
  • 2
  • 11
  • 30

0 Answers0