title: ValueError: cannot convert float NaN to integer"
body: <p>in the following code, I have data frame and I want that if a certain condition satisfied the row where this condition happens to be replaced by nan row  but it doesn't work and when I tried to see how it works case by case I got the error </p>
  
  <pre><code>```{x_r = data.drop(['y'], axis="columns")
      x_nan = np.empty((len(x_r), len(x_r.columns)))
      x_nan[:] = np.nan
      x_2 = x_r.values
      for i in range(0, len(x_r)):
      if y[i] &lt; q_:
      x_2[i, :] = x_nan[i, :]}```
  </code></pre>
  
  <p>then for the individual trail </p>
  
  <pre><code>```{x_2[0,0]=x_nan[0,0]}```
  </code></pre>
  
  <p>and it gave me the following error:</p>
  
  <pre><code> ```{"exec(code_obj, self.user_global_ns, self.user_ns)
     File "&lt;ipython-input-42-d9db7fa21a9c&gt;", line 1, in &lt;module&gt;
     x_2[0,0]=x_nan[0,0]
     ValueError: cannot convert float NaN to integer"}```
  </code></pre>