在使用to_sql写入数据库时,出现报错
TypeError: sequence item 0: expected str instance, dict found
是由于dataframe中存在值为字典的情况,需要将字典转为字符串,或者删除
df.loc[:, ‘xxxx’] = df_main[‘xxxx’].astype(str)
df_subform = df_subform.drop(columns = ignore_columns)
在使用to_sql写入数据库时,出现报错
TypeError: sequence item 0: expected str instance, dict found
是由于dataframe中存在值为字典的情况,需要将字典转为字符串,或者删除
df.loc[:, ‘xxxx’] = df_main[‘xxxx’].astype(str)
df_subform = df_subform.drop(columns = ignore_columns)