Skip to content
Advertisement

Pandas: Looking up the list of sheets in an excel file

The new version of Pandas uses the following interface to load Excel files:

JavaScript

but what if I don’t know the sheets that are available?

For example, I am working with excel files that the following sheets

Data 1, Data 2 …, Data N, foo, bar

but I don’t know N a priori.

Is there any way to get the list of sheets from an excel document in Pandas?

Advertisement

Answer

You can still use the ExcelFile class (and the sheet_names attribute):

JavaScript

see docs for parse for more options…

Advertisement