title: Python Pandas Fillna Median not working
body: <p>I am trying to fill all the nans in a dataframe containing multiple columns and several rows. I am using this to train a multi variate ML-model so I want to fill the nans for each column with the median. Just to test the median function I did this:</p>
  
  <pre><code>training_df.loc[[0]] = np.nan # Sets first row to nan
  print(training_df.isnull().values.any()) # Prints true because we just inserted nans
  test = training_df.fillna(training_df.median()) # Fillna with median
  print(test.isnull().values.any()) # Check afterwards
  </code></pre>
  
  <p>But when I do this nothing happens, the print of the last row still returns True. If I try to change to use the median function like this instead:</p>
  
  <pre><code>training_df.fillna(training_df.median(), inplace=True)
  </code></pre>
  
  <p>Nothing happens as well. If I do this:</p>
  
  <pre><code>training_df = training_df.fillna(training_df.median(), inplace=True)
  </code></pre>
  
  <p>Training_df becomes none. How can I solve this?</p>