Skip to content

Commit

Permalink
add note to v2.2.0.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
natmokval committed Nov 1, 2023
1 parent d0f31f1 commit 34790e7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
23 changes: 21 additions & 2 deletions doc/source/whatsnew/v2.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ Other API changes
Deprecations
~~~~~~~~~~~~

Deprecate aliases ``M`` and ``Q`` in favour of ``ME`` and ``QE`` for offsets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Deprecate aliases ``M``, ``Q``, and ``Y`` in favour of ``ME``, ``QE``, and ``YE`` for offsets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The alias ``M`` is deprecated in favour of ``ME`` for offsets, please use ``ME`` for "month end" instead of ``M`` (:issue:`9586`)

Expand Down Expand Up @@ -252,6 +252,25 @@ For example:
pd.date_range('2020-01-01', periods=3, freq='QE-NOV')
The alias ``Y`` is deprecated in favour of ``YE`` for offsets, please use ``YE`` for "year end" instead of ``Y`` (:issue:`9586`)

For example:

*Previous behavior*:

.. code-block:: ipython
In [9]: pd.date_range('2020-01-01', periods=3, freq='Y-MAR')
Out[9]:
DatetimeIndex(['2020-03-31', '2021-03-31', '2022-03-31'],
dtype='datetime64[ns]', freq='YE-MAR')
*Future behavior*:

.. ipython:: python
pd.date_range('2020-01-01', periods=3, freq='YE-MAR')
Other Deprecations
^^^^^^^^^^^^^^^^^^
- Changed :meth:`Timedelta.resolution_string` to return ``h``, ``min``, ``s``, ``ms``, ``us``, and ``ns`` instead of ``H``, ``T``, ``S``, ``L``, ``U``, and ``N``, for compatibility with respective deprecations in frequency aliases (:issue:`52536`)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ def isocalendar(self) -> DataFrame:

year = _field_accessor(
"year",
"YE",
"Y",
"""
The year of the datetime.
Expand All @@ -1536,7 +1536,7 @@ def isocalendar(self) -> DataFrame:
)
month = _field_accessor(
"month",
"ME",
"M",
"""
The month as January=1, December=12.
Expand Down

0 comments on commit 34790e7

Please sign in to comment.