title: How to keep data types when reading from s3 bucket using pandas
body: <p>Im using a Lambda function to read a csv from s3 and insert the data into a table. When reading from s3 I've noticed that when I read it to disk and the read it in pandas any field that an int and starts with a <code>0</code> is getting turned into a float and any leading <code>0</code> is getting removed. How do keep the int values as ints when reading from s3 bucket?</p>
  <p>for example if I have a field <code>account_number</code> with the value <code>012345678</code> when I read in from s3 it becomes <code>1234567.0</code>, turning my integer to <code>Float64</code>. This is causing downstream problems. How do I get around this issue.</p>
  <p>Sample code:</p>
  <pre><code>export_csv = client.get_object(Bucket = s3_bucket, Key = bo_file_name)
  bo_body = export_csv['Body']
  csv_string = bo_body.read().decode('utf-8')
  bo_df = pd.read_csv(StringIO(csv_string), sep = '|', quotechar = '&quot;')
  #Replacing NaN values with Nulls.
  print('removing nulls from df')
  bo_df.fillna('', inplace = True)
  sql_server = os.getenv('DB_ENDPOINT')
  </code></pre>
  <p>sample schema after reading into <code>pandas</code>:</p>
  <pre><code>first_name                                object
  middle_initial                            object
  last_name                                 object
  date_of_birth                             object
  actnum                                   float64
  </code></pre>