熊猫/ Sqlalchemy的“ NaT”强制?

时间:2019-02-12 23:44:05

标签: python pandas sqlalchemy

我无法在datetime64[ns]值的NaT列上进行批量插入,

我在做,

session.bulk_insert_mappings(SamExtract, df[:1000].to_dict(orient="records"))

它抛出,

sqlalchemy.exc.DataError: (psycopg2.DataError) invalid input syntax for type timestamp: "NaT"
LINE 1: ... 'NaN'::float, false, false, false, false, false, 'NaT'::tim...

然后

psycopg2.DataError: invalid input syntax for type timestamp: "NaT"
LINE 1: ... 'NaN'::float, false, false, false, false, false, 'NaT'::tim...

0 个答案:

没有答案