to_excel()

noun

say it: “too ek-SEL” /tu ɛkˈsɛl/

A pandas method that saves a table as an Excel workbook, so people who use Excel can open it.

What does to_excel() do in pandas?

to_excel() saves a table as an Excel workbook (.xlsx) for people who work in Excel. pandas uses the openpyxl package to write it, so that must be installed; sheet_name= names the sheet and index=False leaves the row numbers out.

clean.to_excel("data/clean/readings.xlsx", sheet_name="Readings", index=False)

In a sentence

  • “to_excel() needs the openpyxl package installed.”
  • “to_excel() gave the principal a workbook she could open in Excel.”

Level: Journeyman · More Python terms at this level

Updated