title: Replacing NaN Values in a Pandas DataFrame with Different Random Uniform Variables
body: <p>I have a uniform distribution in a pandas dataframe column with a few NaN values I'd like to replace.</p>
  
  <p>Since the data is uniformly distributed, I decided that I would like to fill the null values with random uniform samples drawn from a range of the column's min and max values. I used the following code to get the random uniform sample:</p>
  
  <pre><code>df_copy['ep'] = df_copy['ep'].fillna(value=np.random.uniform(3, 331))
  </code></pre>
  
  <p>Of course, using <code>pd.DafaFrame.fillna()</code> replaces all existing NaNs with the same value. I would like each NaN to be a different value. I assume that a <code>for</code> loop could get the job done, but am unsure how to create such a loop to specifically handle these NaN values. Thanks for the help!</p>