pandas.tseries.offsets.Milli#
- class pandas.tseries.offsets.Milli#
Offset
nmilliseconds.Represents a fixed duration of
nmilliseconds (1/1000 of a second) for use in arithmetic with datetime-like objects. Supports sub-second precision in time-series operations.- Parameters:
- nint, default 1
The number of milliseconds represented.
See also
DateOffsetStandard kind of date increment.
Examples
You can use the parameter
nto represent a shift of n milliseconds.>>> from pandas.tseries.offsets import Milli >>> ts = pd.Timestamp(2022, 12, 9, 15) >>> ts Timestamp('2022-12-09 15:00:00')
>>> ts + Milli(n=10) Timestamp('2022-12-09 15:00:00.010000')
>>> ts - Milli(n=10) Timestamp('2022-12-09 14:59:59.990000')
>>> ts + Milli(n=-10) Timestamp('2022-12-09 14:59:59.990000')