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