title: Replacing NaN values with column mean value does not change pandas dataframe NaN values
body: <p>I've search this topic in several posts and I have tried all possible solutions that people give but even though still does not work for me.</p>
  
  <p>Im trying to replace each NaN value from each column, with it's column mean value. In other words:</p>
  
  <pre><code>    A   B
   1: 2   3
   2: 2   1
   3: NaN 4
  
  Column A mean = 1.3
  
      A   B
   1: 2   3
   2: 2   1
   3: 1.3 4 
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>df.fillna(value=0, axis=1, inplace=True)
  </code></pre>
  
  <p>and works fine, but as soon as I tried:</p>
  
  <pre><code>df.fillna(value=df.mean(axis=1), inplace=True)
  </code></pre>
  
  <p>I don't get any changes at all, NaN value still there.</p>
  
  <p>Here is the piece of code:</p>
  
  <pre><code># Drop 'station' column
  del final_df['station']
  # Replace NaN with column mean value
  final_df.fillna(value=final_df.mean(axis=1), inplace=True)
  final_df.head()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FB6aE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FB6aE.png" alt="output"></a></p>