I am trying to replace the NaN in certain columns with the sum of the row in a Pandas DataFrame. See below the example data:
Items| Estimate1| Estimate2| Estimate3|
Item1| NaN | NaN | 8
Item2| NaN | NaN | 5.5|
I am hoping to have Estimate 1 & 2 to be 8 and 5.5 for Item 1 and 2 respectively.
So far I have tried using df.fillna(df.sum(), inplace=True)
but there is no change in the DataFrame. Can anyone assist me correct my code or recommend the right way to do it?