【Python问题】解决python的pandas使用to_excel()函数出现问题

问题描述

使用to_excel()函数报错为:got invalid value of type , expected string or Element

原始代码

import  pandas as pd

test = pd.read_excel('原始数据.xlsx')
print(test)
data.to_excel("修改后数据.xlsx",index=False)

问题解决

在cmd终端或者pycharm的terminal终端执行安装openpyxl 3.0.0 版本

pip install openpyxl==3.0.0  -i https://pypi.douban.com/simple

原来的版本为3.0.2,可能是出现了bug。

【Python问题】解决python的pandas使用to_excel()函数出现问题_第1张图片

你可能感兴趣的:(python,解决python的pandas,使用to_excel,to_excel函数出现问题)