pandas handling of integers and NaNs
pandas converts integer columns with nan values to float64 to accommodate those values.
If the results of a SQL query that contains, say, min() or max() operations, and count() operations, are read into pandas, there is a good chance they will be read in as different data types therefore.
min()ormax()(or many other operations) can result in SQLnullvalues. These will benanvalues when the data is read intopandas, meaning the column will be held as afloat64count()never returnsNULL, meaning the column will be held as an integer (int64)
 This post is licensed under  CC BY 4.0  by the author.