pandas to_sql gives unicode decode error

后端 未结 3 1654
眼角桃花
眼角桃花 2021-02-07 11:27

I have a pandas dataframe I loaded via read_csv that I am trying to push to a database via to_sql when I attempt

df.to_sql(\"assessmentinfo_pivot\", util.ENGINE)         


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 11:58

    I have solved the issue changing the character set in MySQL database (UTF-8) and adding this to the pymysql connection: charset='utf8'.

提交回复
热议问题