pandas.tseries.offsets.Day#
- class pandas.tseries.offsets.Day#
Offset
ndays.Represents a calendar-day offset for use in arithmetic with
datetime,Timestamp, or other datetime-like objects. Addition and subtraction shift the value by exactlyncalendar days, with time-of-day preserved.- Parameters:
- nint, default 1
The number of days represented.
See also
DateOffsetStandard kind of date increment.
Examples
You can use the parameter
nto represent a shift of n days.>>> from pandas.tseries.offsets import Day >>> ts = pd.Timestamp(2022, 12, 9, 15) >>> ts Timestamp('2022-12-09 15:00:00')
>>> ts + Day() Timestamp('2022-12-10 15:00:00') >>> ts - Day(4) Timestamp('2022-12-05 15:00:00')
>>> ts + Day(-4) Timestamp('2022-12-05 15:00:00')