@@ -2460,16 +2460,25 @@ cdef class BusinessMonthEnd(MonthOffset):
2460
2460
"""
2461
2461
DateOffset increments between the last business day of the month.
2462
2462
2463
+ BusinessMonthEnd goes to the next date which is the last business day of the month.
2464
+ To get the last business day of the current month pass the parameter n equals 0.
2465
+
2463
2466
Examples
2464
2467
--------
2465
- >>> from pandas.tseries.offsets import BMonthEnd
2466
- >>> ts = pd.Timestamp('2020-05-24 05:01:15')
2467
- >>> ts + BMonthEnd()
2468
- Timestamp('2020-05-29 05:01:15')
2469
- >>> ts + BMonthEnd(2)
2470
- Timestamp('2020-06-30 05:01:15')
2471
- >>> ts + BMonthEnd(-2)
2472
- Timestamp('2020-03-31 05:01:15')
2468
+ >>> ts = pd.Timestamp(2022, 11, 29)
2469
+ >>> ts + pd.offsets.BMonthEnd()
2470
+ Timestamp('2022-11-30 00:00:00')
2471
+
2472
+ >>> ts = pd.Timestamp(2022, 11, 30)
2473
+ >>> ts + pd.offsets.BMonthEnd()
2474
+ Timestamp('2022-12-30 00:00:00')
2475
+
2476
+ If you want to get the end of the current business month
2477
+ pass the parameter n equals 0:
2478
+
2479
+ >>> ts = pd.Timestamp(2022, 11, 30)
2480
+ >>> ts + pd.offsets.BMonthEnd(0)
2481
+ Timestamp('2022-11-30 00:00:00')
2473
2482
"""
2474
2483
_prefix = " BM"
2475
2484
_day_opt = " business_end"
@@ -2642,11 +2651,24 @@ cdef class SemiMonthEnd(SemiMonthOffset):
2642
2651
2643
2652
Examples
2644
2653
--------
2645
- >>> ts = pd.Timestamp(2022, 1, 1 )
2654
+ >>> ts = pd.Timestamp(2022, 1, 14 )
2646
2655
>>> ts + pd.offsets.SemiMonthEnd()
2647
2656
Timestamp('2022-01-15 00:00:00')
2648
- """
2649
2657
2658
+ >>> ts = pd.Timestamp(2022, 1, 15)
2659
+ >>> ts + pd.offsets.SemiMonthEnd()
2660
+ Timestamp('2022-01-31 00:00:00')
2661
+
2662
+ >>> ts = pd.Timestamp(2022, 1, 31)
2663
+ >>> ts + pd.offsets.SemiMonthEnd()
2664
+ Timestamp('2022-02-15 00:00:00')
2665
+
2666
+ If you want to get the result for the current month pass the parameter n equals 0:
2667
+
2668
+ >>> ts = pd.Timestamp(2022, 1, 15)
2669
+ >>> ts + pd.offsets.SemiMonthEnd(0)
2670
+ Timestamp('2022-01-15 00:00:00')
2671
+ """
2650
2672
_prefix = " SM"
2651
2673
_min_day_of_month = 1
2652
2674
0 commit comments