python使用pandas时候报错TypeError

背景:使用pandas to_excel时候报错TypeError: got invalid input value of type <class 'xml.etree.ElementTree.Element'>, expected string or Element

解决方案

  • pip list发现openpyxl版本为3.0.2
  • pip install openpyxl==3.0.0
  • 换低版本后就可以正常生成文件了,目测是这个版本有问题
posted @ 2020-07-14 16:47  今日店休  阅读(509)  评论(0编辑  收藏  举报