Skip to content

Commit 20828ff

Browse files
Add proposed change to whatsnew
1 parent 2f11edf commit 20828ff

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/source/whatsnew/v1.2.0.rst

+15
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ including other versions of pandas.
1313
Enhancements
1414
~~~~~~~~~~~~
1515

16+
.. _whatsnew_120.improve_timeseries_accessor_naming:
17+
Improve Timeseries accessors Naming Convention
18+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
20+
In modules like Period, PeriodArray, and Timestamp, there are non-Pythonic property names ``dayofweek`` and ``dayofyear`` (:issue:`9606`). We continue to maintain backwards-compatibility by simply aliasing the old naming convention to the new, properly named functions ``day_of_week`` and ``day_of_year``.
21+
22+
For example:
23+
24+
.. ipython:: python
25+
26+
import pandas as pd
27+
28+
per = pd.Period('2017-12-31 22:00', 'H')
29+
per.dayofweek == per.day_of_week == 6
30+
1631
.. _whatsnew_120.duplicate_labels:
1732

1833
Optionally disallow duplicate labels

0 commit comments

Comments
 (0)