34
34
"""
35
35
Read an Excel file into a pandas DataFrame.
36
36
37
- Supports `xls`, `xlsx`, `xlsm`, `xlsb`, and `odf ` file extensions
37
+ Supports `xls`, `xlsx`, `xlsm`, `xlsb`, `odf`, `ods` and `odt ` file extensions
38
38
read from a local filesystem or URL. Supports an option to read
39
39
a single sheet or a list of sheets.
40
40
103
103
of dtype conversion.
104
104
engine : str, default None
105
105
If io is not a buffer or path, this must be set to identify io.
106
- Acceptable values are None, "xlrd", "openpyxl" or "odf".
106
+ Supported engines: "xlrd", "openpyxl", "odf", "pyxlsb", default "xlrd".
107
+ Engine compatibility :
108
+ - "xlrd" supports most old/new Excel file formats.
109
+ - "openpyxl" supports newer Excel file formats.
110
+ - "odf" supports OpenDocument file formats (.odf, .ods, .odt).
111
+ - "pyxlsb" supports Binary Excel files.
107
112
converters : dict, default None
108
113
Dict of functions for converting values in certain columns. Keys can
109
114
either be integers or column labels, values are functions that take one
@@ -785,17 +790,24 @@ def close(self):
785
790
class ExcelFile :
786
791
"""
787
792
Class for parsing tabular excel sheets into DataFrame objects.
788
- Uses xlrd. See read_excel for more documentation
793
+
794
+ Uses xlrd engine by default. See read_excel for more documentation
789
795
790
796
Parameters
791
797
----------
792
798
io : str, path object (pathlib.Path or py._path.local.LocalPath),
793
- a file-like object, xlrd workbook or openpypl workbook.
794
- If a string or path object, expected to be a path to xls, xlsx or odf file.
799
+ a file-like object, xlrd workbook or openpypl workbook.
800
+ If a string or path object, expected to be a path to a
801
+ .xls, .xlsx, .xlsb, .xlsm, .odf, .ods, or .odt file.
795
802
engine : str, default None
796
803
If io is not a buffer or path, this must be set to identify io.
797
- Acceptable values are None, ``xlrd``, ``openpyxl``, ``odf``, or ``pyxlsb``.
798
- Note that ``odf`` reads tables out of OpenDocument formatted files.
804
+ Supported engines: ``xlrd``, ``openpyxl``, ``odf``, ``pyxlsb``,
805
+ default ``xlrd``.
806
+ Engine compatibility :
807
+ - ``xlrd`` supports most old/new Excel file formats.
808
+ - ``openpyxl`` supports newer Excel file formats.
809
+ - ``odf`` supports OpenDocument file formats (.odf, .ods, .odt).
810
+ - ``pyxlsb`` supports Binary Excel files.
799
811
"""
800
812
801
813
from pandas .io .excel ._odfreader import _ODFReader
@@ -817,7 +829,8 @@ def __init__(self, io, engine=None):
817
829
raise ValueError (f"Unknown engine: { engine } " )
818
830
819
831
self .engine = engine
820
- # could be a str, ExcelFile, Book, etc.
832
+
833
+ # Could be a str, ExcelFile, Book, etc.
821
834
self .io = io
822
835
# Always a string
823
836
self ._io = stringify_path (io )
0 commit comments