pandas.tseries.offsets.Nano#

class pandas.tseries.offsets.Nano#

Offset n nanoseconds.

Represents a fixed duration of n nanoseconds (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

DateOffset

Standard kind of date increment.

Examples

You can use the parameter n to 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')