You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG: Fix Period and PeriodIndex support of combined offsets aliases
- [x] closespandas-dev#13730 - [x] tests added / passed - [x] passes ``git
diff upstream/master | flake8 --diff`` - [x] whatsnew entry
Essentially, makes sure any `freq` string passed to a `Period` or
`PeriodIndex` goes through [`_Period._maybe_convert_freq()`](https://g
ithub.com/pydata/pandas/blob/master/pandas/src/period.pyx#L682-L697),
which calls [`to_offset()`](https://github.com/pydata/pandas/blob/mast
er/pandas/tseries/frequencies.py#L389-L451), which is where the logic
for combining aliases is. All the examples in pandas-dev#13730 result in the
correct output, and all existing tests pass. I have not written any
new ones yet — I first wanted to get the opinion of the
maintainers. This PR builds on pandas-dev#13868 (without it, some existing
tests fail).
Author: agraboso <[email protected]>
Closespandas-dev#13874 from agraboso/fix-13730 and squashes the following commits:
49a3783 [agraboso] BUG: Fix Period and PeriodIndex support of combined alias offsets
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.19.0.txt
+3
Original file line number
Diff line number
Diff line change
@@ -783,6 +783,8 @@ Deprecations
783
783
- ``pd.tseries.util.pivot_annual`` is deprecated. Use ``pivot_table`` as alternative, an example is :ref:`here <cookbook.pivot>` (:issue:`736`)
784
784
- ``pd.tseries.util.isleapyear`` has been deprecated and will be removed in a subsequent release. Datetime-likes now have a ``.is_leap_year`` property. (:issue:`13727`)
785
785
- ``Panel4D`` and ``PanelND`` constructors are deprecated and will be removed in a future version. The recommended way to represent these types of n-dimensional data are with the `xarray package <http://xarray.pydata.org/en/stable/>`__. Pandas provides a :meth:`~Panel4D.to_xarray` method to automate this conversion. (:issue:`13564`)
786
+
- ``pandas.tseries.frequencies.get_standard_freq`` is deprecated. Use ``pandas.tseries.frequencies.to_offset(freq).rule_code`` instead. (:issue:`13874`)
787
+
- ``pandas.tseries.frequencies.to_offset``'s ``freqstr`` keyword is deprecated in favor of ``freq``. (:issue:`13874`)
786
788
787
789
.. _whatsnew_0190.prior_deprecations:
788
790
@@ -969,3 +971,4 @@ Bug Fixes
969
971
- Bug in ``pd.read_csv`` in Python 2.x with non-UTF8 encoded, multi-character separated data (:issue:`3404`)
970
972
971
973
- Bug in ``Index`` raises ``KeyError`` displaying incorrect column when column is not in the df and columns contains duplicate values (:issue:`13822`)
974
+
- Bug in ``Period`` and ``PeriodIndex`` creating wrong dates when frequency has combined offset aliases (:issue:`13874`)
0 commit comments