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
+ Acceptable values are None, "xlrd", "openpyxl", "odf", or "pyxlsb".
107
+ Engine compatibility:
108
+ "xlrd" supports most old/new Excel file formats.
109
+ "openpyxl" engine supports newer Excel file formats.
110
+ "odf" engine supports OpenDocument file formats (.odf, .ods, .odt).
111
+ "pyxlsb" engine 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
@@ -784,17 +789,22 @@ def close(self):
784
789
class ExcelFile :
785
790
"""
786
791
Class for parsing tabular excel sheets into DataFrame objects.
787
- Uses xlrd. See read_excel for more documentation
792
+ Uses xlrd by default . See read_excel for more documentation
788
793
789
794
Parameters
790
795
----------
791
796
io : str, path object (pathlib.Path or py._path.local.LocalPath),
792
797
a file-like object, xlrd workbook or openpypl workbook.
793
- If a string or path object, expected to be a path to xls, xlsx or odf file.
798
+ If a string or path object, expected to be a path to a
799
+ .xls, .xlsx, .xlsb, .xlsm, .odf, .ods, or .odt file.
794
800
engine : str, default None
795
801
If io is not a buffer or path, this must be set to identify io.
796
- Acceptable values are None, ``xlrd``, ``openpyxl``, ``odf``, or ``pyxlsb``.
797
- Note that ``odf`` reads tables out of OpenDocument formatted files.
802
+ Acceptable values are None, ``xlrd``, ``openpyxl``, ``odf``, or ``pyxlsb``.
803
+ Engine compatibility:
804
+ ``xlrd`` supports most old/new Excel file formats.
805
+ ``openpyxl`` engine supports newer Excel file formats.
806
+ ``odf`` engine supports OpenDocument file formats (.odf, .ods, .odt).
807
+ ``pyxlsb`` engine supports Binary Excel files.
798
808
"""
799
809
800
810
from pandas .io .excel ._odfreader import _ODFReader
@@ -816,7 +826,8 @@ def __init__(self, io, engine=None):
816
826
raise ValueError (f"Unknown engine: { engine } " )
817
827
818
828
self .engine = engine
819
- # could be a str, ExcelFile, Book, etc.
829
+
830
+ # Could be a str, ExcelFile, Book, etc.
820
831
self .io = io
821
832
# Always a string
822
833
self ._io = stringify_path (io )
0 commit comments