-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
API deprecate date_parser, add date_format #51019
Changes from 24 commits
f2d9eb9
ab53530
c855c4b
389dd71
2e6fbcb
fd5e7c6
1316559
9594c04
7e43e3d
d9f35f9
39cd663
a23f101
5654f91
532080c
4b5cf56
f627ece
113c008
0259f93
5390aed
66e8f2e
f997edd
a7d496b
5d18cd1
4a233d7
63eff32
5737c70
ca0db5c
ab8b537
f1b6940
e9ce938
2a0cafd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,7 @@ Other enhancements | |
- Improved error message when trying to align :class:`DataFrame` objects (for example, in :func:`DataFrame.compare`) to clarify that "identically labelled" refers to both index and columns (:issue:`50083`) | ||
- Added :meth:`DatetimeIndex.as_unit` and :meth:`TimedeltaIndex.as_unit` to convert to different resolutions; supported resolutions are "s", "ms", "us", and "ns" (:issue:`50616`) | ||
- Added new argument ``dtype`` to :func:`read_sql` to be consistent with :func:`read_sql_query` (:issue:`50797`) | ||
- :func:`read_csv` and :func:`read_table` now accept ``date_format`` (:issue:`50601`) | ||
phofl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- | ||
|
||
.. --------------------------------------------------------------------------- | ||
|
@@ -780,6 +781,7 @@ Deprecations | |
- :meth:`Index.is_categorical` has been deprecated. Use :func:`pandas.api.types.is_categorical_dtype` instead (:issue:`50042`) | ||
- :meth:`Index.is_object` has been deprecated. Use :func:`pandas.api.types.is_object_dtype` instead (:issue:`50042`) | ||
- :meth:`Index.is_interval` has been deprecated. Use :func:`pandas.api.types.is_intterval_dtype` instead (:issue:`50042`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs to be removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, apologies for having missed that 🤦 thanks for your review |
||
- Deprecated argument ``date_parser`` in :func:`read_csv` and :func:`read_table` in favour of ``date_format`` (:issue:`50601`) | ||
- Deprecated ``all`` and ``any`` reductions with ``datetime64`` and :class:`DatetimeTZDtype` dtypes, use e.g. ``(obj != pd.Timestamp(0), tz=obj.tz).all()`` instead (:issue:`34479`) | ||
- Deprecated unused arguments ``*args`` and ``**kwargs`` in :class:`Resampler` (:issue:`50977`) | ||
- Deprecated calling ``float`` or ``int`` on a single element :class:`Series` to return a ``float`` or ``int`` respectively. Extract the element before calling ``float`` or ``int`` instead (:issue:`51101`) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,6 +250,16 @@ | |
and pass that; and 3) call `date_parser` once for each row using one or | ||
more strings (corresponding to the columns defined by `parse_dates`) as | ||
arguments. | ||
|
||
.. deprecated:: 2.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is missing in the whatsnew There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add read_excel to the whatsnew? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also needs tests |
||
Use ``date_format`` instead, or read in as ``object`` and then apply | ||
:func:`to_datetime` as-needed. | ||
date_format : str, default ``None`` | ||
If used in conjunction with ``parse_dates``, will parse dates according to this | ||
format. For anything more complex (e.g. different formats for different columns), | ||
please read in as ``object`` and then apply :func:`to_datetime` as-needed. | ||
|
||
.. versionadded:: 2.0.0 | ||
thousands : str, default None | ||
Thousands separator for parsing string columns to numeric. Note that | ||
this parameter is only necessary for columns stored as TEXT in Excel, | ||
|
@@ -387,6 +397,7 @@ def read_excel( | |
verbose: bool = ..., | ||
parse_dates: list | dict | bool = ..., | ||
date_parser: Callable | None = ..., | ||
date_format: str | None = ..., | ||
thousands: str | None = ..., | ||
decimal: str = ..., | ||
comment: str | None = ..., | ||
|
@@ -426,6 +437,7 @@ def read_excel( | |
verbose: bool = ..., | ||
parse_dates: list | dict | bool = ..., | ||
date_parser: Callable | None = ..., | ||
date_format: str | None = ..., | ||
thousands: str | None = ..., | ||
decimal: str = ..., | ||
comment: str | None = ..., | ||
|
@@ -465,6 +477,7 @@ def read_excel( | |
verbose: bool = False, | ||
parse_dates: list | dict | bool = False, | ||
date_parser: Callable | None = None, | ||
date_format: str | None = None, | ||
thousands: str | None = None, | ||
decimal: str = ".", | ||
comment: str | None = None, | ||
|
@@ -509,6 +522,7 @@ def read_excel( | |
verbose=verbose, | ||
parse_dates=parse_dates, | ||
date_parser=date_parser, | ||
date_format=date_format, | ||
thousands=thousands, | ||
decimal=decimal, | ||
comment=comment, | ||
|
@@ -713,6 +727,7 @@ def parse( | |
verbose: bool = False, | ||
parse_dates: list | dict | bool = False, | ||
date_parser: Callable | None = None, | ||
date_format: str | None = None, | ||
thousands: str | None = None, | ||
decimal: str = ".", | ||
comment: str | None = None, | ||
|
@@ -873,6 +888,7 @@ def parse( | |
skip_blank_lines=False, # GH 39808 | ||
parse_dates=parse_dates, | ||
date_parser=date_parser, | ||
date_format=date_format, | ||
thousands=thousands, | ||
decimal=decimal, | ||
comment=comment, | ||
|
@@ -1540,6 +1556,7 @@ def parse( | |
na_values=None, | ||
parse_dates: list | dict | bool = False, | ||
date_parser: Callable | None = None, | ||
date_format: str | None = None, | ||
thousands: str | None = None, | ||
comment: str | None = None, | ||
skipfooter: int = 0, | ||
|
@@ -1572,6 +1589,7 @@ def parse( | |
na_values=na_values, | ||
parse_dates=parse_dates, | ||
date_parser=date_parser, | ||
date_format=date_format, | ||
thousands=thousands, | ||
comment=comment, | ||
skipfooter=skipfooter, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to remember to update this when dict support is implemented