Date Offsets¶
Bodo supports a subset of the offset types in pandas.tseries.offsets
:
DateOffset¶
pd.tseries.offsets.DateOffset
¶
Supported Arguments
n
: integernormalize
: booleanyears
: integermonths
: integerweeks
: integerdays
: integerhours
: integerminutes
: integerseconds
: integermicroseconds
: integernanoseconds
: integeryear
: integermonth
: integerweekday
: integerday
: integerhour
: integerminute
: integersecond
: integermicrosecond
: integernanosecond
: integer
Example Usage
>>> @bodo.jit
>>> def f(ts):
... return ts + pd.tseries.offsets.DateOffset(n=4, normalize=True, weeks=11, hour=2)
>>> ts = pd.Timestamp(year=2020, month=10, day=30, hour=22)
>>> f(ts)
Timestamp('2021-09-03 02:00:00')
Properties¶
pd.tseries.offsets.DateOffset.normalize`¶
pandas.tseries.offsets.DateOffset. normalize
pd.tseries.offsets.DateOffset.n
¶
pandas.tseries.offsets. DateOffset .n
MonthBegin¶
pd.tseries.offsets.MonthBegin
¶
-
pandas.tseries.offsets. MonthBegin (n=1, normalize=False)
Supported Argumentsn
: integernormalize
: boolean
Example Usage
MonthEnd¶
pd.tseries.offsets.MonthEnd
¶
-
pandas.tseries.offsets. MonthEnd (n=1, normalize=False)
Supported Argumentsn
: integernormalize
: boolean
Example Usage
Week¶
pd.tseries.offsets.Week
¶
-
pandas.tseries.offsets. Week (n=1, normalize=False, weekday=None)
Supported Argumentsn
: integernormalize
: booleanweekday
: integer
Example Usage
Binary Operations¶
For all offsets, addition and subtraction with a scalar
datetime.date
, datetime.datetime
or pandas.Timestamp
is supported. Multiplication is also supported with a scalar integer.