pandas.arrays.TimedeltaArray#
- class pandas.arrays.TimedeltaArray(values, dtype=None, freq=_NoDefault.no_default, copy=False)[source]#
Pandas ExtensionArray for timedelta data.
Warning
TimedeltaArray is currently experimental, and its API may change without warning. In particular,
TimedeltaArray.dtype
is expected to change to be an instance of anExtensionDtype
subclass.- Parameters:
- valuesarray-like
The timedelta data.
- dtypenumpy.dtype
Currently, only
numpy.dtype("timedelta64[ns]")
is accepted.- freqOffset, optional
- copybool, default False
Whether to copy the underlying array of data.
Examples
>>> pd.arrays.TimedeltaArray._from_sequence(pd.TimedeltaIndex(['1h', '2h'])) <TimedeltaArray> ['0 days 01:00:00', '0 days 02:00:00'] Length: 2, dtype: timedelta64[ns]
Attributes
None
Methods
None