cudf.TimedeltaIndex#

class cudf.TimedeltaIndex(data=None, unit=None, freq=None, closed=None, dtype='timedelta64[ns]', copy=False, name=None)#

Immutable, ordered and sliceable sequence of timedelta64 data, represented internally as int64.

Parameters
dataarray-like (1-dimensional), optional

Optional datetime-like data to construct index with.

unitstr, optional

This is not yet supported

copybool

Make a copy of input.

freqstr, optional

This is not yet supported

closedstr, optional

This is not yet supported

dtypestr or numpy.dtype, optional

Data type for the output Index. If not specified, the default dtype will be timedelta64[ns].

nameobject

Name to be stored in the index.

Returns
TimedeltaIndex

Examples

>>> import cudf
>>> cudf.TimedeltaIndex([1132223, 2023232, 342234324, 4234324],
...     dtype="timedelta64[ns]")
TimedeltaIndex(['0 days 00:00:00.001132223', '0 days 00:00:00.002023232',
                '0 days 00:00:00.342234324', '0 days 00:00:00.004234324'],
              dtype='timedelta64[ns]')
>>> cudf.TimedeltaIndex([1, 2, 3, 4], dtype="timedelta64[s]",
...     name="delta-index")
TimedeltaIndex(['0 days 00:00:01', '0 days 00:00:02', '0 days 00:00:03',
                '0 days 00:00:04'],
              dtype='timedelta64[s]', name='delta-index')