From f8543d13f00ec9679300e631a4891470b566f6b3 Mon Sep 17 00:00:00 2001 From: tim <43515959+timhunderwood@users.noreply.github.com> Date: Sun, 30 Aug 2020 12:46:06 +0100 Subject: [PATCH 1/5] DOC: Add Notes about difference to numpy behaviour for ddof. GH35985. --- pandas/core/generic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index dd7b02d98ad42..ddebf09004834 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10859,7 +10859,13 @@ def _doc_parms(cls): Returns ------- -%(name1)s or %(name2)s (if level specified)\n""" +%(name1)s or %(name2)s (if level specified) + +Notes +----- +Note that the default divisor (normalization) is different to numpy, +which by default normalizes by N (equivalent to ddof=0). To have the same +behaviour as numpy, use ddof=0.\n""" _bool_doc = """ %(desc)s From 00d050ed0c7f537985b874513ad5d0fea5ce3043 Mon Sep 17 00:00:00 2001 From: tim <43515959+timhunderwood@users.noreply.github.com> Date: Sun, 30 Aug 2020 12:50:47 +0100 Subject: [PATCH 2/5] remove trailing whitespace. --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ddebf09004834..9ae791558eaed 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10863,8 +10863,8 @@ def _doc_parms(cls): Notes ----- -Note that the default divisor (normalization) is different to numpy, -which by default normalizes by N (equivalent to ddof=0). To have the same +Note that the default divisor (normalization) is different to numpy, +which by default normalizes by N (equivalent to ddof=0). To have the same behaviour as numpy, use ddof=0.\n""" _bool_doc = """ From f931e345b948a1e6fa79b691d4406a1aa13d5f1f Mon Sep 17 00:00:00 2001 From: timhunderwood <43515959+timhunderwood@users.noreply.github.com> Date: Sun, 30 Aug 2020 19:14:04 +0100 Subject: [PATCH 3/5] Update pandas/core/generic.py wording change. Co-authored-by: Daniel Saxton <2658661+dsaxton@users.noreply.github.com> --- pandas/core/generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9ae791558eaed..e6bd53a931787 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10863,9 +10863,9 @@ def _doc_parms(cls): Notes ----- -Note that the default divisor (normalization) is different to numpy, -which by default normalizes by N (equivalent to ddof=0). To have the same -behaviour as numpy, use ddof=0.\n""" +The default divisor (normalization) is different from numpy, which +by default normalizes by N. To have the same behaviour as numpy, +use ddof=0.\n""" _bool_doc = """ %(desc)s From ba5b55a2f155b713142ec746fe515ab1f0aec8df Mon Sep 17 00:00:00 2001 From: tim <43515959+timhunderwood@users.noreply.github.com> Date: Mon, 31 Aug 2020 11:19:29 +0100 Subject: [PATCH 4/5] Make wording simpler and remove reference to normalization. --- pandas/core/generic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9ae791558eaed..f78847470bb5a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10863,9 +10863,8 @@ def _doc_parms(cls): Notes ----- -Note that the default divisor (normalization) is different to numpy, -which by default normalizes by N (equivalent to ddof=0). To have the same -behaviour as numpy, use ddof=0.\n""" +To have the same behaviour as `numpy.std`, use `ddof=0` (instead of the +default `ddof=1`)\n""" _bool_doc = """ %(desc)s From 826987776ba0377a799ba8f97f9395b26c988797 Mon Sep 17 00:00:00 2001 From: tim <43515959+timhunderwood@users.noreply.github.com> Date: Mon, 31 Aug 2020 11:20:36 +0100 Subject: [PATCH 5/5] Make wording simpler and remove reference to normalization. --- pandas/core/generic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e6bd53a931787..f78847470bb5a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10863,9 +10863,8 @@ def _doc_parms(cls): Notes ----- -The default divisor (normalization) is different from numpy, which -by default normalizes by N. To have the same behaviour as numpy, -use ddof=0.\n""" +To have the same behaviour as `numpy.std`, use `ddof=0` (instead of the +default `ddof=1`)\n""" _bool_doc = """ %(desc)s