I have two pandas, the first one has 2000 rows looks like:
key B C D
key1 11 nan nan
key2 nan 33 88
key3 nan 44 99
key4 22 55 nan
and the second has about 700 values
key B C D
key4 22 55 77
key2 55 42 63
key3 53 23 nan
I wanna iterate my first data frame by keys and replace the nan values by the matching values if exist in the second pandas like this
key B C D
key1 11 nan nan
key2 55 33 88
key3 53 44 99
key4 22 55 77
my two data frames contain strings I used numbers just for the sake of examples