diff --git a/doc/source/reference/indexing.rst b/doc/source/reference/indexing.rst index 6e58f487d5f4a..1ce75f5aac877 100644 --- a/doc/source/reference/indexing.rst +++ b/doc/source/reference/indexing.rst @@ -407,6 +407,7 @@ Methods :toctree: api/ DatetimeIndex.mean + DatetimeIndex.std TimedeltaIndex -------------- diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index eb7638df301f7..71d38d3b3f73b 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1923,6 +1923,26 @@ def std( keepdims: bool = False, skipna: bool = True, ): + """ + Return sample standard deviation over requested axis. + + Normalized by N-1 by default. This can be changed using the ddof argument + + Parameters + ---------- + axis : int optional, default None + Axis for the function to be applied on. + ddof : int, default 1 + Degrees of Freedom. The divisor used in calculations is N - ddof, + where N represents the number of elements. + skipna : bool, default True + Exclude NA/null values. If an entire row/column is NA, the result will be + NA. + + Returns + ------- + Timedelta + """ # Because std is translation-invariant, we can get self.std # by calculating (self - Timestamp(0)).std, and we can do it # without creating a copy by using a view on self._ndarray