title: How do I prevent pandas from recasting my integer values to floats?
body: <p>I am <a href="https://stackoverflow.com/a/23345276/189134">merging</a> two CSV files with input below. </p>
  
  <p><strong>file1.csv</strong></p>
  
  <pre><code>Id,attr1,attr2,attr3
  1,True,7,"Purple"
  2,False,19.8,"Cucumber"
  3,False,-0.5,"A string with a comma, because it has one"
  4,True,2,"Nope"
  5,True,4.0,"Tuesday"
  6,False,1,"Failure"
  </code></pre>
  
  <p><strong>file2.csv</strong></p>
  
  <pre><code>Id,attr4,attr5,attr6
  2,"python",500000.12,False
  5,"program",3,True
  3,"Another string",-5,False
  </code></pre>
  
  <p>When I run this code</p>
  
  <pre><code>import pandas as pd
  df1 = pd.read_csv("file1.csv")
  df2 = pd.read_csv("file2.csv")
  merged = df1.merge(df2, on="Id", how="outer").fillna("")
  merged.to_csv("merged.csv", index=False)
  </code></pre>
  
  <p>I get output like this</p>
  
  <pre><code>Id,attr1,attr2,attr3,attr4,attr5,attr6
  1,True,7.0,Purple,,,
  2,False,19.8,Cucumber,python,500000.12,False
  3,False,-0.5,"A string with a comma, because it has one",Another string,-5.0,False
  4,True,2.0,Nope,,,
  5,True,4.0,Tuesday,program,3.0,True
  6,False,1.0,Failure,,,
  </code></pre>
  
  <p>Notice that <code>attr2</code> from several of my records has been converted from an <code>int</code> to a <code>float</code>. </p>
  
  <pre><code>1,True,7.0,Purple,,,
  </code></pre>
  
  <p>vs the expected</p>
  
  <pre><code>1,True,7,Purple,,,
  </code></pre>
  
  <p>For this example data set it is a minor annoyance. However, when I am running it against my large set of data, this behavior is occuring on my <code>Id</code> column as well. This would break processes further down my workflow chain.</p>
  
  <p>How do I prevent pandas from doing this conversion either for the entire file or, ideally, for specific columns?</p>