Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

Python mysql-connector doesn't handle numpy.nan (1 reply)

$
0
0
Hi,

My workflow requires that I bulk insert pandas dataframes to a mysql database.

pandas uses numpy.nan to represent null values in a dataframe's float columns.
Unfortunately, when converting said values to a query, the mysql-connector converts numpy.nan to a string; 'nan', failing to insert it to the float column in the db.

I have a code workaround where I replace all numpy.nan values with None, but that is compute intensive and takes up much more space.

Is it possible to open a pull request on mysql-connector github to fix this?

Viewing all articles
Browse latest Browse all 384

Trending Articles