📜  pandas to excel 在现有的 excel 文件中添加另一个工作表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:08.966000             🧑  作者: Mango

代码示例1
import pandas as pd
from openpyxl import load_workbook
 
FilePath = "your excel path"
ExcelWorkbook = load_workbook(FilePath)
writer = pd.ExcelWriter(FilePath, engine = 'openpyxl')
writer.book = ExcelWorkbook
df.to_excel(writer, sheet_name = 'your sheet name')
writer.save()
writer.close()