pandas.tseries.offsets.BusinessMonthBegin#
- class pandas.tseries.offsets.BusinessMonthBegin#
DateOffset of one month at the first business day.
BusinessMonthBegin goes to the next date which is the first business day of the month.
- Parameters:
- nint, 默认值 1
The number of months represented.
- normalizebool,默认 False
在生成日期范围之前将开始/结束日期规范化到午夜。
参见
DateOffset标准的日期增量类型。
Examples
>>> ts = pd.Timestamp(2022, 11, 30) >>> ts + pd.offsets.BMonthBegin() Timestamp('2022-12-01 00:00:00')
>>> ts = pd.Timestamp(2022, 12, 1) >>> ts + pd.offsets.BMonthBegin() Timestamp('2023-01-02 00:00:00')
If you want to get the start of the current business month:
>>> ts = pd.Timestamp(2022, 12, 1) >>> pd.offsets.BMonthBegin().rollback(ts) Timestamp('2022-12-01 00:00:00')
Attributes
base返回调用偏移量对象的副本,其中 n=1 且所有其他属性都相同。
返回表示频率的字符串。
返回偏移量的额外参数字典。
返回表示基本频率的字符串。
Methods
copy()返回频率的副本。
is_anchored()(已弃用) 返回频率是否为单位频率 (n=1) 的布尔值.
is_month_end(ts)如果时间戳发生在月份结束时,则返回布尔值。
is_month_start(ts)如果时间戳发生在月份开始时,则返回布尔值。
is_on_offset(dt)如果时间戳与此频率相交,则返回布尔值。
is_quarter_end(ts)如果时间戳发生在季度结束时,则返回布尔值。
is_quarter_start(ts)如果时间戳发生在季度开始时,则返回布尔值。
is_year_end(ts)如果时间戳发生在年份结束时,则返回布尔值。
is_year_start(ts)如果时间戳发生在年份开始时,则返回布尔值。
rollback(dt)如果提供的日期不在偏移量上,则将其向后滚动到下一个偏移量。
rollforward(dt)如果提供的日期不在偏移量上,则将其向前滚动到下一个偏移量。