Skip to content

Commit e397215

Browse files
committed
Merge pull request #6133 from jorisvandenbossche/doc-clarify-excel
DOC: clarify that ExcelFile is not deprecated but only moved (#5435)
2 parents f89ae34 + d2ad659 commit e397215

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

doc/source/io.rst

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,28 +1802,32 @@ Not escaped:
18021802
Excel files
18031803
-----------
18041804

1805-
The ``read_excel`` method can read Excel 2003 (``.xls``) and
1805+
The :func:`~pandas.read_excel` method can read Excel 2003 (``.xls``) and
18061806
Excel 2007 (``.xlsx``) files using the ``xlrd`` Python
18071807
module and use the same parsing code as the above to convert tabular data into
18081808
a DataFrame. See the :ref:`cookbook<cookbook.excel>` for some
18091809
advanced strategies
18101810

1811-
.. note::
1811+
Besides ``read_excel`` you can also read Excel files using the ``ExcelFile``
1812+
class. The following two command are equivalent:
18121813

1813-
The prior method of accessing Excel is now deprecated as of 0.12.0,
1814-
this will work but will be removed in a future version.
1814+
.. code-block:: python
18151815
1816-
.. code-block:: python
1816+
# using the ExcelFile class
1817+
xls = pd.ExcelFile('path_to_file.xls')
1818+
xls.parse('Sheet1', index_col=None, na_values=['NA'])
18171819
1818-
from pandas.io.parsers import ExcelFile
1819-
xls = ExcelFile('path_to_file.xls')
1820-
xls.parse('Sheet1', index_col=None, na_values=['NA'])
1820+
# using the read_excel function
1821+
read_excel('path_to_file.xls', 'Sheet1', index_col=None, na_values=['NA'])
18211822
1822-
Replaced by
1823+
The class based approach can be used to read multiple sheets or to introspect
1824+
the sheet names using the ``sheet_names`` attribute.
18231825

1824-
.. code-block:: python
1826+
.. note::
18251827

1826-
read_excel('path_to_file.xls', 'Sheet1', index_col=None, na_values=['NA'])
1828+
The prior method of accessing ``ExcelFile`` has been moved from
1829+
``pandas.io.parsers`` to the top level namespace starting from pandas
1830+
0.12.0.
18271831

18281832
.. versionadded:: 0.13
18291833

0 commit comments

Comments
 (0)