python - Pandas: Looking up the list of sheets in an excel file -
the new version of pandas uses the following interface load excel files:
read_excel('path_to_file.xls', 'sheet1', index_col=none, na_values=['na'])
but if don't know sheets available?
for example, working excel files following sheets
data 1, data 2 ..., data n, foo, bar
but don't know n
priori.
is there way list of sheets excel document in pandas?
you can still use excelfile class (and sheet_names
attribute):
xl = pd.excelfile('foo.xls') xl.sheet_names # see sheet names xl.parse(sheet_name) # read specific sheet dataframe
see docs parse more options...
Comments
Post a Comment