Skip to content

Commit dbe3278

Browse files
authored
DOC: add examples to offsets classes: FY5253, FY5253Quarter (#54608)
* docs: add examples to offsets classes FY5253, FY5253Quarter * add examples, see also section, a description for parameter n * add missing parameter normalize
1 parent 13e034a commit dbe3278

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

pandas/_libs/tslibs/offsets.pyx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3549,6 +3549,9 @@ cdef class FY5253(FY5253Mixin):
35493549
Parameters
35503550
----------
35513551
n : int
3552+
The number of fiscal years represented.
3553+
normalize : bool, default False
3554+
Normalize start/end dates to midnight before generating date range.
35523555
weekday : int {0, 1, ..., 6}, default 0
35533556
A specific integer for the day of the week.
35543557
@@ -3571,11 +3574,31 @@ cdef class FY5253(FY5253Mixin):
35713574
- "nearest" means year end is **weekday** closest to last day of month in year.
35723575
- "last" means year end is final **weekday** of the final month in fiscal year.
35733576
3577+
See Also
3578+
--------
3579+
:class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
3580+
35743581
Examples
35753582
--------
3583+
In the example below the default parameters give the next 52-53 week fiscal year.
3584+
35763585
>>> ts = pd.Timestamp(2022, 1, 1)
35773586
>>> ts + pd.offsets.FY5253()
35783587
Timestamp('2022-01-31 00:00:00')
3588+
3589+
By the parameter ``startingMonth`` we can specify
3590+
the month in which fiscal years end.
3591+
3592+
>>> ts = pd.Timestamp(2022, 1, 1)
3593+
>>> ts + pd.offsets.FY5253(startingMonth=3)
3594+
Timestamp('2022-03-28 00:00:00')
3595+
3596+
52-53 week fiscal year can be specified by
3597+
``weekday`` and ``variation`` parameters.
3598+
3599+
>>> ts = pd.Timestamp(2022, 1, 1)
3600+
>>> ts + pd.offsets.FY5253(weekday=5, startingMonth=12, variation="last")
3601+
Timestamp('2022-12-31 00:00:00')
35793602
"""
35803603

35813604
_prefix = "RE"
@@ -3729,6 +3752,9 @@ cdef class FY5253Quarter(FY5253Mixin):
37293752
Parameters
37303753
----------
37313754
n : int
3755+
The number of business quarters represented.
3756+
normalize : bool, default False
3757+
Normalize start/end dates to midnight before generating date range.
37323758
weekday : int {0, 1, ..., 6}, default 0
37333759
A specific integer for the day of the week.
37343760
@@ -3754,11 +3780,32 @@ cdef class FY5253Quarter(FY5253Mixin):
37543780
- "nearest" means year end is **weekday** closest to last day of month in year.
37553781
- "last" means year end is final **weekday** of the final month in fiscal year.
37563782
3783+
See Also
3784+
--------
3785+
:class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
3786+
37573787
Examples
37583788
--------
3789+
In the example below the default parameters give
3790+
the next business quarter for 52-53 week fiscal year.
3791+
37593792
>>> ts = pd.Timestamp(2022, 1, 1)
37603793
>>> ts + pd.offsets.FY5253Quarter()
37613794
Timestamp('2022-01-31 00:00:00')
3795+
3796+
By the parameter ``startingMonth`` we can specify
3797+
the month in which fiscal years end.
3798+
3799+
>>> ts = pd.Timestamp(2022, 1, 1)
3800+
>>> ts + pd.offsets.FY5253Quarter(startingMonth=3)
3801+
Timestamp('2022-03-28 00:00:00')
3802+
3803+
Business quarters for 52-53 week fiscal year can be specified by
3804+
``weekday`` and ``variation`` parameters.
3805+
3806+
>>> ts = pd.Timestamp(2022, 1, 1)
3807+
>>> ts + pd.offsets.FY5253Quarter(weekday=5, startingMonth=12, variation="last")
3808+
Timestamp('2022-04-02 00:00:00')
37623809
"""
37633810

37643811
_prefix = "REQ"

0 commit comments

Comments
 (0)