From fccbd70729f5562009d85676cd752fd05c90b824 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Wed, 24 May 2023 23:44:29 +0200 Subject: [PATCH 1/2] DOC: add missing parameters to offsets classes: BQuarterBegin, BQuarterEnd, QuarterBegin, QuarterEnd --- pandas/_libs/tslibs/offsets.pyx | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index f062db77fb79b..697b3f54fee75 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -2506,6 +2506,19 @@ cdef class BQuarterEnd(QuarterOffset): startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ... startingMonth = 3 corresponds to dates like 3/30/2007, 6/29/2007, ... + Parameters + ---------- + n : int, default 1 + The number of years represented. + normalize : bool, default False + Normalize start/end dates to midnight before generating date range. + startingMonth : int, default 3 + A specific integer for the month of the year from which we start Quarters. + + See Also + -------- + :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment. + Examples -------- >>> from pandas.tseries.offsets import BQuarterEnd @@ -2534,6 +2547,19 @@ cdef class BQuarterBegin(QuarterOffset): startingMonth = 2 corresponds to dates like 2/01/2007, 5/01/2007, ... startingMonth = 3 corresponds to dates like 3/01/2007, 6/01/2007, ... + Parameters + ---------- + n : int, default 1 + The number of years represented. + normalize : bool, default False + Normalize start/end dates to midnight before generating date range. + startingMonth : int, default 3 + A specific integer for the month of the year from which we start Quarters. + + See Also + -------- + :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment. + Examples -------- >>> from pandas.tseries.offsets import BQuarterBegin @@ -2562,6 +2588,19 @@ cdef class QuarterEnd(QuarterOffset): startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ... startingMonth = 3 corresponds to dates like 3/31/2007, 6/30/2007, ... + Parameters + ---------- + n : int, default 1 + The number of years represented. + normalize : bool, default False + Normalize start/end dates to midnight before generating date range. + startingMonth : int, default 3 + A specific integer for the month of the year from which we start Quarters. + + See Also + -------- + :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment. + Examples -------- >>> ts = pd.Timestamp(2022, 1, 1) @@ -2590,6 +2629,19 @@ cdef class QuarterBegin(QuarterOffset): startingMonth = 2 corresponds to dates like 2/01/2007, 5/01/2007, ... startingMonth = 3 corresponds to dates like 3/01/2007, 6/01/2007, ... + Parameters + ---------- + n : int, default 1 + The number of years represented. + normalize : bool, default False + Normalize start/end dates to midnight before generating date range. + startingMonth : int, default 3 + A specific integer for the month of the year from which we start Quarters. + + See Also + -------- + :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment. + Examples -------- >>> ts = pd.Timestamp(2022, 1, 1) From f3ce08166667ee497426e5c973b55760703f0b49 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Thu, 25 May 2023 23:39:53 +0200 Subject: [PATCH 2/2] correct the description of the parameter n --- pandas/_libs/tslibs/offsets.pyx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 697b3f54fee75..e3004aaf30dbf 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -2509,11 +2509,11 @@ cdef class BQuarterEnd(QuarterOffset): Parameters ---------- n : int, default 1 - The number of years represented. + The number of quarters represented. normalize : bool, default False Normalize start/end dates to midnight before generating date range. startingMonth : int, default 3 - A specific integer for the month of the year from which we start Quarters. + A specific integer for the month of the year from which we start quarters. See Also -------- @@ -2550,11 +2550,11 @@ cdef class BQuarterBegin(QuarterOffset): Parameters ---------- n : int, default 1 - The number of years represented. + The number of quarters represented. normalize : bool, default False Normalize start/end dates to midnight before generating date range. startingMonth : int, default 3 - A specific integer for the month of the year from which we start Quarters. + A specific integer for the month of the year from which we start quarters. See Also -------- @@ -2591,11 +2591,11 @@ cdef class QuarterEnd(QuarterOffset): Parameters ---------- n : int, default 1 - The number of years represented. + The number of quarters represented. normalize : bool, default False Normalize start/end dates to midnight before generating date range. startingMonth : int, default 3 - A specific integer for the month of the year from which we start Quarters. + A specific integer for the month of the year from which we start quarters. See Also -------- @@ -2632,11 +2632,11 @@ cdef class QuarterBegin(QuarterOffset): Parameters ---------- n : int, default 1 - The number of years represented. + The number of quarters represented. normalize : bool, default False Normalize start/end dates to midnight before generating date range. startingMonth : int, default 3 - A specific integer for the month of the year from which we start Quarters. + A specific integer for the month of the year from which we start quarters. See Also --------