pandas.tseries.offsets.Nano#
- class pandas.tseries.offsets.Nano#
Offset
nnanoseconds.Represents a fixed duration of
nnanoseconds (1/1,000,000,000 of a second) for use in arithmetic with datetime-like objects. The finest resolution tick offset, suitable for high-precision timestamps.- Parameters:
- nint, default 1
The number of nanoseconds represented.
See also
DateOffsetStandard kind of date increment.
Examples
You can use the parameter
nto represent a shift of n nanoseconds.>>> from pandas.tseries.offsets import Nano >>> ts = pd.Timestamp(2022, 12, 9, 15) >>> ts Timestamp('2022-12-09 15:00:00')
>>> ts + Nano(n=1000) Timestamp('2022-12-09 15:00:00.000001')
>>> ts - Nano(n=1000) Timestamp('2022-12-09 14:59:59.999999')
>>> ts + Nano(n=-1000) Timestamp('2022-12-09 14:59:59.999999')