读写EXCEL表
D:/pycharm/time_series/gui/SpecialValueProcessingDialog.py:49: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas . This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed. data.to_excel(save_file_path)
data = pd.read_excel(open_file_path,sheet_name=0,header=header,index_col=index_col)
print(data.head())
data.replace([-9999,0],np.nan)
data.to_excel(save_file_path)
警告翻译过来:由于xlwt软件包不再维护,xlwt引擎将在未来版本的pandas中删除。这是pandas中唯一支持xls格式写入的引擎。安装openpyxl并改为写入xlsx文件。您可以设置选项io.excel.xls文件。写入“xlwt”以消除此警告。虽然此选项已弃用,并且还会引发警告,但可以全局设置它并抑制警告。
保存excel表时保存为.xlsx格式,而不是.xls格式,就不会有警告