pandas.ExcelFile.sheet_names — pandas 3.0.0.dev0+2104.ge637b4290d documentation (original) (raw)

property ExcelFile.sheet_names[source]#

Names of the sheets in the document.

This is particularly useful for loading a specific sheet into a DataFrame when you do not know the sheet names beforehand.

Returns:

list of str

List of sheet names in the document.

See also

ExcelFile.parse

Parse a sheet into a DataFrame.

read_excel

Read an Excel file into a pandas DataFrame. If you know the sheet names, it may be easier to specify them directly to read_excel.

Examples

file = pd.ExcelFile("myfile.xlsx")
file.sheet_names
["Sheet1", "Sheet2"]