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
- 换低版本后就可以正常生成文件了,目测是这个版本有问题