@@ -1802,28 +1802,32 @@ Not escaped:
1802
1802
Excel files
1803
1803
-----------
1804
1804
1805
- The `` read_excel ` ` method can read Excel 2003 (``.xls ``) and
1805
+ The :func: ` ~pandas. read_excel ` method can read Excel 2003 (``.xls ``) and
1806
1806
Excel 2007 (``.xlsx ``) files using the ``xlrd `` Python
1807
1807
module and use the same parsing code as the above to convert tabular data into
1808
1808
a DataFrame. See the :ref: `cookbook<cookbook.excel> ` for some
1809
1809
advanced strategies
1810
1810
1811
- .. note ::
1811
+ Besides ``read_excel `` you can also read Excel files using the ``ExcelFile ``
1812
+ class. The following two command are equivalent:
1812
1813
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
1815
1815
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' ])
1817
1819
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' ])
1821
1822
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.
1823
1825
1824
- .. code-block :: python
1826
+ .. note ::
1825
1827
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.
1827
1831
1828
1832
.. versionadded :: 0.13
1829
1833
0 commit comments