modin.pandas.DatetimeIndex.mean

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

Return the mean value of the Array.

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

  • axis (int, optional, default 0) – The axis to calculate the mean over. This parameter is ignored - 0 is the only valid axis.

Return type:

scalar Timestamp

See also

numpy.ndarray.mean

Returns the average of array elements along a given axis.

Series.mean

Return the mean value in a Series.

Notes

mean is only defined for Datetime and Timedelta dtypes, not for Period.

Examples

>>> idx = pd.date_range('2001-01-01 00:00', periods=3)
>>> idx
DatetimeIndex(['2001-01-01', '2001-01-02', '2001-01-03'], dtype='datetime64[ns]', freq=None)
>>> idx.mean()
Timestamp('2001-01-02 00:00:00')
Copy