Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
保存在新工作表中,但使用pandas将旧工作表保存在excel中_Excel_Python 3.x_Pandas - Fatal编程技术网

保存在新工作表中,但使用pandas将旧工作表保存在excel中

保存在新工作表中,但使用pandas将旧工作表保存在excel中,excel,python-3.x,pandas,Excel,Python 3.x,Pandas,我找到了此链接并尝试了以下示例: 它不保留以前的工作表。有没有办法保留原始工作表?您可以使用将df\u附加到excel()帮助函数,该函数是 注意:此功能需要openpyxl模块 用法示例: append_df_to_excel('d:/temp/test.xlsx', df) append_df_to_excel('d:/temp/test.xlsx', df, header=None, index=False) append_df_to_excel('d:/temp/test.xlsx'

我找到了此链接并尝试了以下示例:


它不保留以前的工作表。有没有办法保留原始工作表?

您可以使用
将df\u附加到excel()
帮助函数,该函数是

注意:此功能需要
openpyxl
模块

用法示例:

append_df_to_excel('d:/temp/test.xlsx', df)

append_df_to_excel('d:/temp/test.xlsx', df, header=None, index=False)

append_df_to_excel('d:/temp/test.xlsx', df, sheet_name='Sheet2', index=False)

append_df_to_excel('d:/temp/test.xlsx', df, sheet_name='Sheet2', index=False, startrow=25)