Note: you’ll have to install openpyxl if you get the following error: Here is a template that you may apply in Python to export your DataFrame: df.to_excel(r'Path where the exported excel file will be stored\File Name.xlsx', index = False)Īnd if you want to export your DataFrame to a specific Excel Sheet, then you may use this template: df.to_excel(r'Path where the exported excel file will be stored\File Name.xlsx', sheet_name='Your sheet name', index = False)
You can export Pandas DataFrame to an Excel file using to_excel.