Is it possible to ignore or prevent automatic typing when executing a sql command and populating a data frame? I have NA's in certain columns and those columns are converted to float64 (when they should be int64 with some NAs) and when written out (using to_csv) leave decimal points which does not make sense for that column. I have no way of knowing if a certain sql query will return the same column as int64 or float64. I propose setting dtype=object or dtype=False so I can do an easy data dump.

Comment From: nbonnotte

What SQL system are you using? Have you tried forcing the type of your column in the SQL query?

Comment From: jorisvandenbossche

@biomorph You are probably seeing the consequence of the fact that pandas has no NA for int columns. So if you have an integer column that contains a NaN, then this column will automatically be converted to a float. As a consequence, if you read an integer column from a SQL database that contains missing values, this will automatically converted to a float column in pandas.

See also http://pandas.pydata.org/pandas-docs/stable/gotchas.html#support-for-integer-na

Comment From: jorisvandenbossche

@biomorph I am closing this issue, but if you have further questions or clarifications if I misinterpreted your issue, feel free to add further comments!