From 7854a6c943083f1e42ce3e08165a9c6e8708f302 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Sun, 3 Mar 2019 14:12:20 -0600 Subject: [PATCH 1/3] DOC: Fixed api ref --- doc/source/reference/arrays.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/reference/arrays.rst b/doc/source/reference/arrays.rst index a129b75636536..4cf8db895f0ac 100644 --- a/doc/source/reference/arrays.rst +++ b/doc/source/reference/arrays.rst @@ -259,7 +259,7 @@ Every period in a ``PeriodArray`` must have the same ``freq``. .. autosummary:: :toctree: api/ - arrays.DatetimeArray + arrays.PeriodArray PeriodDtype .. _api.arrays.interval: From 531c1e417ce0869e373c76c113a2f8df7ed40c4b Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Mon, 4 Mar 2019 08:15:56 -0600 Subject: [PATCH 2/3] lint --- pandas/core/arrays/period.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/arrays/period.py b/pandas/core/arrays/period.py index 3ddceb8c2839d..cb4a314258a27 100644 --- a/pandas/core/arrays/period.py +++ b/pandas/core/arrays/period.py @@ -104,13 +104,15 @@ class PeriodArray(dtl.DatetimeLikeArrayMixin, dtl.DatelikeOps): is an ndarray of integers, when `freq` is required. When `values` is a PeriodArray (or box around), it's checked that ``values.freq`` matches `freq`. + dtype : PeriodDtype, optional + A PeriodDtype instance from which to extract a `freq`. copy : bool, default False Whether to copy the ordinals before storing. See Also -------- period_array : Create a new PeriodArray. - pandas.PeriodIndex : Immutable Index for period data. + PeriodIndex : Immutable Index for period data. Notes ----- From 895b13d13b15e4a135249076c2ffdab86cd8e5af Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 7 Mar 2019 11:30:36 -0600 Subject: [PATCH 3/3] update --- pandas/core/arrays/period.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/arrays/period.py b/pandas/core/arrays/period.py index cb4a314258a27..12d36695f5b79 100644 --- a/pandas/core/arrays/period.py +++ b/pandas/core/arrays/period.py @@ -105,7 +105,8 @@ class PeriodArray(dtl.DatetimeLikeArrayMixin, dtl.DatelikeOps): is a PeriodArray (or box around), it's checked that ``values.freq`` matches `freq`. dtype : PeriodDtype, optional - A PeriodDtype instance from which to extract a `freq`. + A PeriodDtype instance from which to extract a `freq`. If both + `freq` and `dtype` are specified, then the frequencies must match. copy : bool, default False Whether to copy the ordinals before storing.