Reading and writing Excel

pd.read_excel() reads an Excel workbook sheet into a DataFrame (parameters sheet_name, header, usecols), and to_excel() writes a DataFrame, possibly via an ExcelWriter for several sheets. The underlying engine, such as openpyxl for .xlsx, must be installed.

Example

df = pd.read_excel('ventes.xlsx', sheet_name='2025')
df.to_excel('sortie.xlsx', index=False)

Related concepts

The whole glossary