2

When I perform pandas.read_sql(), integer columns that contain NULL values are converted float.

How can I avoid that? I tried coerce_float=False but that didn't do it.

[The inability to handle NULL values in integer columns in pandas is REALLY annoying!]

EDIT: I know that pandas can not have NULL values in integer columns. What I would like to achieve is to keep the columns as strings or objects.

Konstantin
  • 2,451
  • 1
  • 24
  • 26
  • No way yet. https://stackoverflow.com/a/21290084 – Zero Sep 06 '17 at 13:06
  • 1
    Yes, I am aware of that. But I would like to at least keep them as strings or objects, and avoid the conversion to floats which has several drawbacks, e.g. losing precision. – Konstantin Sep 06 '17 at 14:08

0 Answers0