class pandas.ExcelFile(path_or_buff
class pandas.ExcelFile(path_or_buff
Parameters:
path_or_bufferstr, bytes, path object (pathlib.Path or py._path.local.LocalPath),
A file-like object, xlrd workbook or openpyxl workbook. If a string or path object,
expected to be a path to a .xls, .xlsx, .xlsb, .xlsm, .odf, .ods, or .odt file.
calamine supports Excel (.xls, .xlsx, .xlsm, .xlsb) and OpenDocument (.ods) file
formats.
Changed in version 1.2.0: The engine xlrd now only supports old-style .xls files.
When engine=None, the following logic will be used to determine the engine:
Warning
Please do not report issues when using xlrd to read .xlsx files. This is not
supported, switch to using openpyxl instead.
engine_kwargsdict, optional
Arbitrary keyword arguments passed to excel engine.
Examples
file = pd.ExcelFile('myfile.xlsx')
with pd.ExcelFile("myfile.xls") as xls:
df1 = pd.read_excel(xls, "Sheet1")
Attributes
book
sheet_names
Methods
close()
close io if necessary