title: Stop Pandas from converting int to float due to an insertion in another column
body: <p>I have a <code>DataFrame</code> with two columns: a column of <code>int</code> and a column of <code>str</code>.</p>
  <ul>
  <li>I understand that if I insert <code>NaN</code> into the <code>int</code> column, Pandas will convert all the <code>int</code> into <code>float</code> because there is no <code>NaN</code> value for an <code>int</code>.</li>
  <li>However, when I insert <code>None</code> into the <code>str</code> column, Pandas converts all my <code>int</code> to <code>float</code> as well. This doesn't make sense to me - why does the value I put in column 2 affect column 1?</li>
  </ul>
  <p>Here's a simple working example):</p>
  <pre><code>import pandas as pd
  df = pd.DataFrame()
  df[&quot;int&quot;] = pd.Series([], dtype=int)
  df[&quot;str&quot;] = pd.Series([], dtype=str)
  
  df.loc[0] = [0, &quot;zero&quot;]
  print(df)
  print()
  
  df.loc[1] = [1, None]
  print(df)
  </code></pre>
  <p>The output is:</p>
  <pre><code>   int   str
  0    0  zero
  
     int   str
  0  0.0  zero
  1  1.0   NaN
  </code></pre>
  <p>Is there any way to make the output the following:</p>
  <pre><code>   int   str
  0    0  zero
  
     int   str
  0    0  zero
  1    1   NaN
  </code></pre>
  <p>without recasting the first column to <code>int</code>.</p>
  <ul>
  <li><p>I prefer using <code>int</code> instead of <code>float</code> because the actual data in
  that column are integers. If there's not workaround, I'll just
  use <code>float</code> though.</p>
  </li>
  <li><p>I prefer not having to recast because in my actual code, I don't<br />
  store the actual <code>dtype</code>.</p>
  </li>
  <li><p>I also need the data inserted row-by-row.</p>
  </li>
  </ul>