报错:IllegalCharacterError

其原因是字段中包含了unicode字符。

解决方案:

# 首先,安装python包xlsxwriter
pip install xlsxwriter

# 其次,用'xlsxwriter'替换默认引擎'openpyxl'
df.to_excel("test.xlsx", engine='xlsxwriter',index=False,sheet_name="Sheet1")

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-04-12
  • 2021-08-19
  • 2022-12-23
  • 2021-12-08
猜你喜欢
  • 2022-02-10
  • 2022-12-23
  • 2021-05-31
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案