pandas.tseries.offsets.SemiMonthBegin#

class pandas.tseries.offsets.SemiMonthBegin#

每月两个DateOffset,分别在第一个和指定日期重复。

Parameters:
nint, 默认值 1

The number of months represented.

normalizebool,默认 False

在生成日期范围之前将开始/结束日期规范化到午夜。

day_of_monthint, {1, 3,…,27}, default 15

月份中的特定日期。

Examples

>>> ts = pd.Timestamp(2022, 1, 1)
>>> ts + pd.offsets.SemiMonthBegin()
Timestamp('2022-01-15 00:00:00')

Attributes

base

返回调用偏移量对象的副本,其中 n=1 且所有其他属性都相同。

day_of_month

freqstr

返回表示频率的字符串。

kwds

返回偏移量的额外参数字典。

n

name

返回表示基本频率的字符串。

nanos

normalize

rule_code

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)

如果提供的日期不在偏移量上,则将其向前滚动到下一个偏移量。