OK, so I got Pandas read_sql_query() to work with the Netezza decimal data type. I did this by switching from pyodbc to pypyodbc (described here ).
I noticed some strange things with unicode in the results, so I passed a few extra parameters to the connection object in pypyodbc , and now everything works correctly. I needed to change unicode_results=False and ansi=true (for DB output / messages) ... but I think I'm fine with this, since my data should fit in ASCII, and I'm not even sure how much NZ supports unicode anyway.
The working code below is to get a request from data.frame :
import pypyodbc import pandas as pd connection = \ pypyodbc.connect( "Driver=NetezzaSQL;SERVERNAME=nzserver;DATABASE=MASTER;PORT=5480;USERNAME=user_guy;PASSWORD=******", ansi=True, unicode_results=False) sql = """select cast(0.0 as decimal(6,2)) as decimal_test, cast(0 as integer) as int_test, cast('aosenuth' as varchar(5)) as varchar_test , current_timestamp as timestamp_test """ data = pd.io.sql.read_sql_query(sql, connection, index_col=None, coerce_float=True) print data.shape
joefromct Sep 29 '15 at 15:55 2015-09-29 15:55
source share