import pandas as pd with pd.ExcelWriter('a.xls') as writer: df1.to_excel(writer, 'sheet1') df2.to_excel(writer, 'sheet2')
from openpyxl import load_workbook book = load_workbook('a.xlsx') writer = pd.ExcelWriter('a.xlsx', engine='openpyxl') writer.book = book df1.to_excel(writer, 'sheet1') df2.to_excel(writer, 'sheet2') writer.save()
pip3 install openpyxl
df1 = pd.DataFrame({"需求名稱": prd_name, "需求bug總數": prd_bugnum, "Android BUG數": prd_bugnum_android, "iOS BUG數": prd_bugnum_ios, "server BUG數": prd_bugnum_server, "FE BUG數": prd_bugnum_fe, "需求變動個數": prd_bugnum_pm, "設計缺陷個數": prd_bugnum_design })