Skip to content

NaN value in dataframe caused _write_mysql error #4199

Closed
@simomo

Description

@simomo
  • I have a dataframe with nan value inside and wanna use io.sql.write_frame function to store it in a table.
  • But, nan value can not be treated well by MySQLdb, it will raise an exception:
OperationalError: (1054, "Unknown column 'nan' in 'field list'")
  • I've tried to convert all nan value to None, but it turns out to be impossible, fillna function treat param value=None as "the caller don't pass a value" not "the nan value should be None"
  • I think add some hacks to convert nan to None in io.sql._write_mysql can fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions