@@ -2251,9 +2251,13 @@ cdef class BYearEnd(YearOffset):
2251
2251
The number of years represented.
2252
2252
normalize : bool, default False
2253
2253
Normalize start/end dates to midnight before generating date range.
2254
- month : int, default 1
2254
+ month : int, default 12
2255
2255
A specific integer for the month of the year.
2256
2256
2257
+ See Also
2258
+ --------
2259
+ :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
2260
+
2257
2261
Examples
2258
2262
--------
2259
2263
>>> from pandas.tseries.offsets import BYearEnd
@@ -2280,6 +2284,19 @@ cdef class BYearBegin(YearOffset):
2280
2284
"""
2281
2285
DateOffset increments between the first business day of the year.
2282
2286
2287
+ Parameters
2288
+ ----------
2289
+ n : int, default 1
2290
+ The number of years represented.
2291
+ normalize : bool, default False
2292
+ Normalize start/end dates to midnight before generating date range.
2293
+ month : int, default 1
2294
+ A specific integer for the month of the year.
2295
+
2296
+ See Also
2297
+ --------
2298
+ :class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
2299
+
2283
2300
Examples
2284
2301
--------
2285
2302
>>> from pandas.tseries.offsets import BYearBegin
@@ -2292,6 +2309,8 @@ cdef class BYearBegin(YearOffset):
2292
2309
Timestamp('2020-01-01 05:01:15')
2293
2310
>>> ts + BYearBegin(2)
2294
2311
Timestamp('2022-01-03 05:01:15')
2312
+ >>> ts + BYearBegin(month=11)
2313
+ Timestamp('2020-11-02 05:01:15')
2295
2314
"""
2296
2315
2297
2316
_outputName = " BusinessYearBegin"
@@ -2306,6 +2325,15 @@ cdef class YearEnd(YearOffset):
2306
2325
2307
2326
YearEnd goes to the next date which is the end of the year.
2308
2327
2328
+ Parameters
2329
+ ----------
2330
+ n : int, default 1
2331
+ The number of years represented.
2332
+ normalize : bool, default False
2333
+ Normalize start/end dates to midnight before generating date range.
2334
+ month : int, default 12
2335
+ A specific integer for the month of the year.
2336
+
2309
2337
See Also
2310
2338
--------
2311
2339
:class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
@@ -2320,10 +2348,14 @@ cdef class YearEnd(YearOffset):
2320
2348
>>> ts + pd.offsets.YearEnd()
2321
2349
Timestamp('2023-12-31 00:00:00')
2322
2350
2351
+ >>> ts = pd.Timestamp(2022, 1, 1)
2352
+ >>> ts + pd.offsets.YearEnd(month=2)
2353
+ Timestamp('2022-02-28 00:00:00')
2354
+
2323
2355
If you want to get the end of the current year:
2324
2356
2325
2357
>>> ts = pd.Timestamp(2022, 12, 31)
2326
- >>> pd.offsets.YearEnd().rollback (ts)
2358
+ >>> pd.offsets.YearEnd().rollforward (ts)
2327
2359
Timestamp('2022-12-31 00:00:00')
2328
2360
"""
2329
2361
@@ -2347,6 +2379,15 @@ cdef class YearBegin(YearOffset):
2347
2379
2348
2380
YearBegin goes to the next date which is the start of the year.
2349
2381
2382
+ Parameters
2383
+ ----------
2384
+ n : int, default 1
2385
+ The number of years represented.
2386
+ normalize : bool, default False
2387
+ Normalize start/end dates to midnight before generating date range.
2388
+ month : int, default 1
2389
+ A specific integer for the month of the year.
2390
+
2350
2391
See Also
2351
2392
--------
2352
2393
:class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.
@@ -2361,6 +2402,10 @@ cdef class YearBegin(YearOffset):
2361
2402
>>> ts + pd.offsets.YearBegin()
2362
2403
Timestamp('2024-01-01 00:00:00')
2363
2404
2405
+ >>> ts = pd.Timestamp(2022, 1, 1)
2406
+ >>> ts + pd.offsets.YearBegin(month=2)
2407
+ Timestamp('2022-02-01 00:00:00')
2408
+
2364
2409
If you want to get the start of the current year:
2365
2410
2366
2411
>>> ts = pd.Timestamp(2023, 1, 1)
0 commit comments