我试图使用查询插入数据
engine = create_engine('scot://pswd:xyz@ hostnumb:port/db_name')
dataframe.to_sql('table_name', engine, if_exists='replace') 但是有一列是字典,我无法插入它,只有列名被插入。
我试图将postgres中的列类型从text更改为json对象。仍然无法插入。
我尝试使用json.dumps(),但仍然面对issue.getting错误为"dtype: object不是JSON序列化“
发布于 2017-07-13 23:15:05
尝试指定dtype。所以在你的例子中,你会说
dataframe.to_sql('table_name', engine, if_exists='replace',dtype =
{'relevant_column':sqlalchemy.types.JSON})https://stackoverflow.com/questions/43141620
复制相似问题