pandas.tseries.offsets.BYearBegin#

class pandas.tseries.offsets.BYearBegin#

DateOffset increments between the first business day of the year.

This offset moves dates to the first business day of the specified month (default January), skipping weekends.

Parameters:
nint, default 1

The number of years represented.

normalizebool, default False

Normalize start/end dates to midnight before generating date range.

monthint, default 1

A specific integer for the month of the year.

Attributes

month

Return the month of the year on which this offset applies.

See also

DateOffset

Standard kind of date increment.

Examples

>>> from pandas.tseries.offsets import BYearBegin
>>> ts = pd.Timestamp('2020-05-24 05:01:15')
>>> ts + BYearBegin()
Timestamp('2021-01-01 05:01:15')
>>> ts - BYearBegin()
Timestamp('2020-01-01 05:01:15')
>>> ts + BYearBegin(-1)
Timestamp('2020-01-01 05:01:15')
>>> ts + BYearBegin(2)
Timestamp('2022-01-03 05:01:15')
>>> ts + BYearBegin(month=11)
Timestamp('2020-11-02 05:01:15')