pandas.Timedelta.nanoseconds#
- Timedelta.nanoseconds#
Return the number of nanoseconds (n), where 0 <= n < 1 microsecond.
This is the nanoseconds component of the Timedelta, which represents the residual nanoseconds that are not captured by higher-order components such as days, seconds, or microseconds. The value is always in the range [0, 999].
- Returns:
- int
Number of nanoseconds.
See also
Timedelta.componentsReturn all attributes with assigned values (i.e. days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).
Examples
Using string input
>>> td = pd.Timedelta('1 days 2 min 3 us 42 ns')
>>> td.nanoseconds 42
Using integer input
>>> td = pd.Timedelta(42, unit='ns') >>> td.nanoseconds 42