File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2412,11 +2412,28 @@ cdef class MonthEnd(MonthOffset):
2412
2412
"""
2413
2413
DateOffset of one month end.
2414
2414
2415
+ MonthEnd goes to the next date which is an end of the month.
2416
+ To get the end of the current month pass the parameter n equals 0.
2417
+
2418
+ See Also
2419
+ --------
2420
+ :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
2421
+
2415
2422
Examples
2416
2423
--------
2417
- >>> ts = pd.Timestamp(2022, 1, 1 )
2424
+ >>> ts = pd.Timestamp(2022, 1, 30 )
2418
2425
>>> ts + pd.offsets.MonthEnd()
2419
2426
Timestamp('2022-01-31 00:00:00')
2427
+
2428
+ >>> ts = pd.Timestamp(2022, 1, 31)
2429
+ >>> ts + pd.offsets.MonthEnd()
2430
+ Timestamp('2022-02-28 00:00:00')
2431
+
2432
+ If you want to get the end of the current month pass the parameter n equals 0:
2433
+
2434
+ >>> ts = pd.Timestamp(2022, 1, 31)
2435
+ >>> ts + pd.offsets.MonthEnd(0)
2436
+ Timestamp('2022-01-31 00:00:00')
2420
2437
"""
2421
2438
_period_dtype_code = PeriodDtypeCode.M
2422
2439
_prefix = " M"
You can’t perform that action at this time.
0 commit comments