From 2765681f17227f21bc03f5cdb9d6f1a3d8b88897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Wed, 13 Oct 2021 18:38:43 -0400 Subject: [PATCH 1/3] DOC: DatetimeArray.std --- pandas/core/arrays/datetimes.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index eb7638df301f7..b51f7e3976f93 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 : 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 From c5642a30bc5b36b45a4f23fa41089abc8d0e4e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Thu, 14 Oct 2021 16:49:36 -0400 Subject: [PATCH 2/3] int --- pandas/core/arrays/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index b51f7e3976f93..71d38d3b3f73b 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1930,7 +1930,7 @@ def std( Parameters ---------- - axis : optional, default None + 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, From 9b77738d7d27acab7fd6e20e53cd82d8c602175d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Mon, 18 Oct 2021 14:44:52 -0400 Subject: [PATCH 3/3] added to doc/source/reference/indexing.rst --- doc/source/reference/indexing.rst | 1 + 1 file changed, 1 insertion(+) 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 --------------