pandas.tseries.offsets.BHalfYearEnd.startingMonth#

BHalfYearEnd.startingMonth#

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

For the *Begin offsets this is a month in which a half-year starts, so startingMonth=1 anchors on January 1 and July 1. For the *End offsets it is a month in which a half-year ends, so startingMonth=1 anchors on January 31 and July 31.

See also

HalfYearOffset.rule_code

Return the rule code for the half-year offset.

QuarterOffset.startingMonth

Similar property for quarter-based offsets.

Examples

A *Begin offset starts its half-years in startingMonth:

>>> pd.offsets.HalfYearBegin(startingMonth=2).startingMonth
2
>>> pd.Timestamp("2022-01-15") + pd.offsets.HalfYearBegin(startingMonth=2)
Timestamp('2022-02-01 00:00:00')

An *End offset ends its half-years in startingMonth:

>>> pd.offsets.HalfYearEnd(startingMonth=2).startingMonth
2
>>> pd.Timestamp("2022-01-15") + pd.offsets.HalfYearEnd(startingMonth=2)
Timestamp('2022-02-28 00:00:00')