pandas.tseries.offsets.BHalfYearBegin#

class pandas.tseries.offsets.BHalfYearBegin#

DateOffset increments between the first business day of each half-year.

startingMonth = 1 corresponds to dates like 1/01/2007, 7/01/2007, … startingMonth = 2 corresponds to dates like 2/01/2007, 8/01/2007, … startingMonth = 3 corresponds to dates like 3/01/2007, 9/01/2007, …

Parameters:
nint, default 1

The number of half-years represented.

normalizebool, default False

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

startingMonthint, default 1

The month of the year in which half-years start.

Attributes

startingMonth

Return the month of the year that anchors the half-years.

See also

DateOffset

Standard kind of date increment.

Examples

>>> from pandas.tseries.offsets import BHalfYearBegin
>>> ts = pd.Timestamp('2020-05-24 05:01:15')
>>> ts + BHalfYearBegin()
Timestamp('2020-07-01 05:01:15')
>>> ts + BHalfYearBegin(2)
Timestamp('2021-01-01 05:01:15')
>>> ts + BHalfYearBegin(startingMonth=2)
Timestamp('2020-08-03 05:01:15')
>>> ts + BHalfYearBegin(-1)
Timestamp('2020-01-01 05:01:15')