modin.pandas.TimedeltaIndex.mean

TimedeltaIndex.mean(*, skipna: bool = True, axis: AxisInt | None = 0) native_pd.Timedelta[source]

Return the mean value of the Timedelta values.

Parameters:
  • skipna (bool, default True) – Whether to ignore any NaT elements.

  • axis (int, optional, default 0) –

Return type:

scalar Timedelta

Examples

>>> idx = pd.to_timedelta([1, 2, 3, 1], unit='D')
>>> idx
TimedeltaIndex(['1 days', '2 days', '3 days', '1 days'], dtype='timedelta64[ns]', freq=None)
>>> idx.mean()
Timedelta('1 days 18:00:00')
Copy

See also

numpy.ndarray.mean

Returns the average of array elements along a given axis.

Series.mean

Return the mean value in a Series.