|
250 | 250 | and pass that; and 3) call `date_parser` once for each row using one or |
251 | 251 | more strings (corresponding to the columns defined by `parse_dates`) as |
252 | 252 | arguments. |
| 253 | +
|
| 254 | + .. deprecated:: 2.0.0 |
| 255 | + Use ``date_format`` instead, or read in as ``object`` and then apply |
| 256 | + :func:`to_datetime` as-needed. |
| 257 | +date_format : str, default ``None`` |
| 258 | + If used in conjunction with ``parse_dates``, will parse dates according to this |
| 259 | + format. For anything more complex (e.g. different formats for different columns), |
| 260 | + please read in as ``object`` and then apply :func:`to_datetime` as-needed. |
| 261 | +
|
| 262 | + .. versionadded:: 2.0.0 |
253 | 263 | thousands : str, default None |
254 | 264 | Thousands separator for parsing string columns to numeric. Note that |
255 | 265 | this parameter is only necessary for columns stored as TEXT in Excel, |
@@ -386,7 +396,8 @@ def read_excel( |
386 | 396 | na_filter: bool = ..., |
387 | 397 | verbose: bool = ..., |
388 | 398 | parse_dates: list | dict | bool = ..., |
389 | | - date_parser: Callable | None = ..., |
| 399 | + date_parser: Callable | lib.NoDefault = ..., |
| 400 | + date_format: str | None = ..., |
390 | 401 | thousands: str | None = ..., |
391 | 402 | decimal: str = ..., |
392 | 403 | comment: str | None = ..., |
@@ -425,7 +436,8 @@ def read_excel( |
425 | 436 | na_filter: bool = ..., |
426 | 437 | verbose: bool = ..., |
427 | 438 | parse_dates: list | dict | bool = ..., |
428 | | - date_parser: Callable | None = ..., |
| 439 | + date_parser: Callable | lib.NoDefault = ..., |
| 440 | + date_format: str | None = ..., |
429 | 441 | thousands: str | None = ..., |
430 | 442 | decimal: str = ..., |
431 | 443 | comment: str | None = ..., |
@@ -464,7 +476,8 @@ def read_excel( |
464 | 476 | na_filter: bool = True, |
465 | 477 | verbose: bool = False, |
466 | 478 | parse_dates: list | dict | bool = False, |
467 | | - date_parser: Callable | None = None, |
| 479 | + date_parser: Callable | lib.NoDefault = lib.no_default, |
| 480 | + date_format: str | None = None, |
468 | 481 | thousands: str | None = None, |
469 | 482 | decimal: str = ".", |
470 | 483 | comment: str | None = None, |
@@ -508,6 +521,7 @@ def read_excel( |
508 | 521 | verbose=verbose, |
509 | 522 | parse_dates=parse_dates, |
510 | 523 | date_parser=date_parser, |
| 524 | + date_format=date_format, |
511 | 525 | thousands=thousands, |
512 | 526 | decimal=decimal, |
513 | 527 | comment=comment, |
@@ -711,7 +725,8 @@ def parse( |
711 | 725 | na_values=None, |
712 | 726 | verbose: bool = False, |
713 | 727 | parse_dates: list | dict | bool = False, |
714 | | - date_parser: Callable | None = None, |
| 728 | + date_parser: Callable | lib.NoDefault = lib.no_default, |
| 729 | + date_format: str | None = None, |
715 | 730 | thousands: str | None = None, |
716 | 731 | decimal: str = ".", |
717 | 732 | comment: str | None = None, |
@@ -870,6 +885,7 @@ def parse( |
870 | 885 | skip_blank_lines=False, # GH 39808 |
871 | 886 | parse_dates=parse_dates, |
872 | 887 | date_parser=date_parser, |
| 888 | + date_format=date_format, |
873 | 889 | thousands=thousands, |
874 | 890 | decimal=decimal, |
875 | 891 | comment=comment, |
@@ -1537,7 +1553,8 @@ def parse( |
1537 | 1553 | nrows: int | None = None, |
1538 | 1554 | na_values=None, |
1539 | 1555 | parse_dates: list | dict | bool = False, |
1540 | | - date_parser: Callable | None = None, |
| 1556 | + date_parser: Callable | lib.NoDefault = lib.no_default, |
| 1557 | + date_format: str | None = None, |
1541 | 1558 | thousands: str | None = None, |
1542 | 1559 | comment: str | None = None, |
1543 | 1560 | skipfooter: int = 0, |
@@ -1570,6 +1587,7 @@ def parse( |
1570 | 1587 | na_values=na_values, |
1571 | 1588 | parse_dates=parse_dates, |
1572 | 1589 | date_parser=date_parser, |
| 1590 | + date_format=date_format, |
1573 | 1591 | thousands=thousands, |
1574 | 1592 | comment=comment, |
1575 | 1593 | skipfooter=skipfooter, |
|
0 commit comments