Skip to content

Commit 0e10a9d

Browse files
grahamjeffriesjorisvandenbossche
authored andcommitted
remove read_excel kwd NotImplemented error, update documentation pandas-dev#11544
1 parent 5033a4a commit 0e10a9d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

doc/source/io.rst

+15
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,21 @@ indices to be parsed.
25032503
25042504
read_excel('path_to_file.xls', 'Sheet1', parse_cols=[0, 2, 3])
25052505
2506+
2507+
Parsing Dates
2508+
+++++++++++++
2509+
2510+
Datetime-like values are automatically converted to the appropriate dtype when
2511+
reading the excel file. When there is a column of strings that have to be parsed
2512+
to a datetime, you can use the `parse_dates` keyword:
2513+
2514+
.. code-block:: python
2515+
2516+
read_excel('path_to_file.xls', 'Sheet1', parse_dates=['date_strings'])
2517+
2518+
So this should *not* be used when the column in excel has already a datetime-like
2519+
type.
2520+
25062521
Cell Converters
25072522
+++++++++++++++
25082523

pandas/io/excel.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,10 @@ def _parse_excel(self, sheetname=0, header=0, skiprows=None, names=None,
335335
if 'chunksize' in kwds:
336336
raise NotImplementedError("chunksize keyword of read_excel "
337337
"is not implemented")
338-
if parse_dates:
339-
raise NotImplementedError("parse_dates keyword of read_excel "
340-
"is not implemented")
341338

342-
if date_parser is not None:
343-
raise NotImplementedError("date_parser keyword of read_excel "
344-
"is not implemented")
339+
if parse_dates and not index_col:
340+
warn("The 'parse_dates=True' keyword of read_excel was provided"
341+
" without an 'index_col' keyword value.")
345342

346343
import xlrd
347344
from xlrd import (xldate, XL_CELL_DATE,

0 commit comments

Comments
 (0)