how to save a pandas DataFrame to an excel file?

df.to_csv("output.csv", index=False)

OR

df.to_excel("output.xlsx")

Leave a Comment