From d2ad6591a9ec1ee6f11e1a34e56cca2d4aabc679 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 27 Jan 2014 18:38:15 +0100 Subject: [PATCH] DOC: clarify that ExcelFile is not deprecated but only moved (GH5435) --- doc/source/io.rst | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/source/io.rst b/doc/source/io.rst index e12e6ff6d5956..4c3a97500e789 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -1802,28 +1802,32 @@ Not escaped: Excel files ----------- -The ``read_excel`` method can read Excel 2003 (``.xls``) and +The :func:`~pandas.read_excel` method can read Excel 2003 (``.xls``) and Excel 2007 (``.xlsx``) files using the ``xlrd`` Python module and use the same parsing code as the above to convert tabular data into a DataFrame. See the :ref:`cookbook` for some advanced strategies -.. note:: +Besides ``read_excel`` you can also read Excel files using the ``ExcelFile`` +class. The following two command are equivalent: - The prior method of accessing Excel is now deprecated as of 0.12.0, - this will work but will be removed in a future version. +.. code-block:: python - .. code-block:: python + # using the ExcelFile class + xls = pd.ExcelFile('path_to_file.xls') + xls.parse('Sheet1', index_col=None, na_values=['NA']) - from pandas.io.parsers import ExcelFile - xls = ExcelFile('path_to_file.xls') - xls.parse('Sheet1', index_col=None, na_values=['NA']) + # using the read_excel function + read_excel('path_to_file.xls', 'Sheet1', index_col=None, na_values=['NA']) - Replaced by +The class based approach can be used to read multiple sheets or to introspect +the sheet names using the ``sheet_names`` attribute. - .. code-block:: python +.. note:: - read_excel('path_to_file.xls', 'Sheet1', index_col=None, na_values=['NA']) + The prior method of accessing ``ExcelFile`` has been moved from + ``pandas.io.parsers`` to the top level namespace starting from pandas + 0.12.0. .. versionadded:: 0.13