pandas.Timedelta.unit#

Timedelta.unit#

Return the unit of Timedelta object.

This is the resolution of the underlying int64 representation: one of 's', 'ms', 'us' or 'ns'.

Returns:
str

See also

Timedelta.value

Return the value of Timedelta object in nanoseconds.

Timedelta.as_unit

Convert the underlying int64 representation to the given unit.

Examples

>>> td = pd.Timedelta(42, unit='us')
>>> td.unit
'us'