From 06882d72bac533029001e2fae9cb82ada23c00f2 Mon Sep 17 00:00:00 2001 From: Pranav Saibhushan Ravuri Date: Fri, 24 Mar 2023 19:24:15 +0530 Subject: [PATCH] ***updates*** - updated docstrings of pandas.offsers.MonthBegin, MonthEnd, BMonthBegin, BMonthEnd --- pandas/_libs/tslibs/offsets.pyx | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 0e2ac692e579c..ff068921545c5 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -2546,7 +2546,6 @@ cdef class MonthEnd(MonthOffset): DateOffset of one month end. MonthEnd goes to the next date which is an end of the month. - To get the end of the current month pass the parameter n equals 0. See Also -------- @@ -2562,10 +2561,10 @@ cdef class MonthEnd(MonthOffset): >>> ts + pd.offsets.MonthEnd() Timestamp('2022-02-28 00:00:00') - If you want to get the end of the current month pass the parameter n equals 0: + If you want to get the end of the current month: >>> ts = pd.Timestamp(2022, 1, 31) - >>> ts + pd.offsets.MonthEnd(0) + >>> pd.offsets.MonthEnd().rollforward(ts) Timestamp('2022-01-31 00:00:00') """ _period_dtype_code = PeriodDtypeCode.M @@ -2578,7 +2577,6 @@ cdef class MonthBegin(MonthOffset): DateOffset of one month at beginning. MonthBegin goes to the next date which is a start of the month. - To get the start of the current month pass the parameter n equals 0. See Also -------- @@ -2594,10 +2592,10 @@ cdef class MonthBegin(MonthOffset): >>> ts + pd.offsets.MonthBegin() Timestamp('2023-01-01 00:00:00') - If you want to get the start of the current month pass the parameter n equals 0: + If you want to get the start of the current month: >>> ts = pd.Timestamp(2022, 12, 1) - >>> ts + pd.offsets.MonthBegin(0) + >>> pd.offsets.MonthBegin().rollback(ts) Timestamp('2022-12-01 00:00:00') """ _prefix = "MS" @@ -2609,7 +2607,6 @@ cdef class BusinessMonthEnd(MonthOffset): DateOffset increments between the last business day of the month. BusinessMonthEnd goes to the next date which is the last business day of the month. - To get the last business day of the current month pass the parameter n equals 0. Examples -------- @@ -2621,11 +2618,10 @@ cdef class BusinessMonthEnd(MonthOffset): >>> ts + pd.offsets.BMonthEnd() Timestamp('2022-12-30 00:00:00') - If you want to get the end of the current business month - pass the parameter n equals 0: + If you want to get the end of the current business month: >>> ts = pd.Timestamp(2022, 11, 30) - >>> ts + pd.offsets.BMonthEnd(0) + >>> pd.offsets.BMonthEnd().rollforward(ts) Timestamp('2022-11-30 00:00:00') """ _prefix = "BM" @@ -2637,8 +2633,7 @@ cdef class BusinessMonthBegin(MonthOffset): DateOffset of one month at the first business day. BusinessMonthBegin goes to the next date which is the first business day - of the month. To get the first business day of the current month pass - the parameter n equals 0. + of the month. Examples -------- @@ -2650,11 +2645,10 @@ cdef class BusinessMonthBegin(MonthOffset): >>> ts + pd.offsets.BMonthBegin() Timestamp('2023-01-02 00:00:00') - If you want to get the start of the current business month pass - the parameter n equals 0: + If you want to get the start of the current business month: >>> ts = pd.Timestamp(2022, 12, 1) - >>> ts + pd.offsets.BMonthBegin(0) + >>> pd.offsets.BMonthBegin().rollback(ts) Timestamp('2022-12-01 00:00:00') """ _prefix = "BMS"