This is my code, how do I add another data frame to the same excel, say: 'df3', but on a different sheet:
df2.to_excel('Invoicing Detail Output File.xlsx', index = False)
Write directly to a new excel ( see ):
with pd.ExcelWriter('Invoicing Detail Output File.xlsx') as writer:
df2.to_excel(writer, sheet_name='Sheet1')
df3.to_excel(writer, sheet_name='Sheet2')
Or append to existing excel:
with ExcelWriter('Invoicing Detail Output File.xlsx', mode='a') as writer:
df3.to_excel(writer, sheet_name='Sheet2')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.