python to excel

#Python, pandas
#To export a pandas dataframe into Excel

df.to_excel(r'Path where you want to store the exported excel file\File Name.xlsx', index = False)

Here is what the above code is Doing:
1. We’re using the to_excel() method on our dataframe.
2. We’re passing the path of the directory where we want to store the exported excel file.
3. We’re also passing the name of the excel file using the ‘File Name.xlsx’ parameter.
4. We’re setting the index parameter to false so that pandas doesn’t export the index values along with the dataframe.