for example, suppose I have a dataframe which is like,
enter code here
df = pd.DataFrame([[1,      np.nan, 2],
                   [2,      3,      5],
                   [np.nan, 4,      6],
                   [None, 4,      6]])
however, how can I fill the NaN in this dataframe with the average value of the row that NaN belongs to? The result of this dataframe should be
enter code here
     0     1    2
0  1.0   1.5  2.0
1  2.0   3.0  5.0
2  5.0   4.0  6.0
3  5.0   4.0  6.0
 
     
    