When i do
from sqlalchemy import create_engine import pandas as pd engine = create_engine('sqlite://') conn = engine.connect() conn.execute("create table test (a float)") for _ in range(5): conn.execute("insert into test values (NULL)") df = pd.read_sql_query("select * from test", engine) #df = pd.read_sql_table("test", engine) df.a
the result is a column of None values, not a float("nan") . This is very annoying, especially if you read floating point columns with NULL values.
The read_sql_table version read_sql_table fine, as I assume it can use type information.
Can read_sql_query be easily configured to interpret NULL values ββas float("nan") ?
source share