Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_frame fails to write NaN values (io.sql) #4034

Closed
jhubele opened this issue Jun 25, 2013 · 1 comment
Closed

write_frame fails to write NaN values (io.sql) #4034

jhubele opened this issue Jun 25, 2013 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request

Comments

@jhubele
Copy link

jhubele commented Jun 25, 2013

At least connections via pyodbc or ceODBC do not accept NaN values in INSERT statements.

If I replace the NaN with None it is working as expected, i.e. these are NULLs in the data base:

frame2 = frame.where((pd.notnull(frame)), None)
data = [tuple(x) for x in frame2.values]
cur.executemany(insert_query, data)

It is pretty expensive to copy the data frame. There is probably a better solution.

I have tested this only with SQL Server for which I have written a small extension to sql.py.

@jreback
Copy link
Contributor

jreback commented Jun 29, 2013

closing as duped by #2754

@jreback jreback closed this as completed Jun 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants