pandas.tseries.offsets.BHalfYearEnd.startingMonth#
- BHalfYearEnd.startingMonth#
Return the month of the year that anchors the half-years.
For the
*Beginoffsets this is a month in which a half-year starts, sostartingMonth=1anchors on January 1 and July 1. For the*Endoffsets it is a month in which a half-year ends, sostartingMonth=1anchors on January 31 and July 31.See also
HalfYearOffset.rule_codeReturn the rule code for the half-year offset.
QuarterOffset.startingMonthSimilar property for quarter-based offsets.
Examples
A
*Beginoffset starts its half-years instartingMonth:>>> 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
*Endoffset ends its half-years instartingMonth:>>> pd.offsets.HalfYearEnd(startingMonth=2).startingMonth 2
>>> pd.Timestamp("2022-01-15") + pd.offsets.HalfYearEnd(startingMonth=2) Timestamp('2022-02-28 00:00:00')