pandas to excel add another sheet in existing excel file

Solutions on MaxInterview for pandas to excel add another sheet in existing excel file by the best coders in the world

showing results for - "pandas to excel add another sheet in existing excel file"
Maia
20 Jan 2018
1import pandas as pd
2from openpyxl import load_workbook
3 
4FilePath = "your excel path"
5ExcelWorkbook = load_workbook(FilePath)
6writer = pd.ExcelWriter(FilePath, engine = 'openpyxl')
7writer.book = ExcelWorkbook
8df.to_excel(writer, sheet_name = 'your sheet name')
9writer.save()
10writer.close()
11