From 178f9dc56e18082a5b9f40b8b891a505ae320570 Mon Sep 17 00:00:00 2001 From: ZhuBaohe Date: Thu, 22 Feb 2018 14:19:21 +0800 Subject: [PATCH 1/4] DOC: correct min_count param docstring --- 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 8034cf89cf8b7..dd9b630127a2b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7867,8 +7867,8 @@ def _doc_parms(cls): .. versionadded :: 0.22.0 - Added with the default being 1. This means the sum or product - of an all-NA or empty series is ``NaN``. + Added with the default being 0. This means the sum or product + of an all-NA or empty series is ``NaN`` if min_count=1. """ From 9e8546b2c11ce49b76d880ecad6dcabe21c9b086 Mon Sep 17 00:00:00 2001 From: ZhuBaohe Date: Thu, 22 Feb 2018 20:40:35 +0800 Subject: [PATCH 2/4] reverse the logic --- 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 dd9b630127a2b..e5f7b7ceec673 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7855,7 +7855,7 @@ def _doc_parms(cls): >>> pd.Series([np.nan]).prod() 1.0 ->>> pd.Series([np.nan]).sum(min_count=1) +>>> pd.Series([np.nan]).prod(min_count=1) nan """ @@ -7868,7 +7868,7 @@ def _doc_parms(cls): .. versionadded :: 0.22.0 Added with the default being 0. This means the sum or product - of an all-NA or empty series is ``NaN`` if min_count=1. + of an all-NA or empty series is 0 and 1, respectively. """ From afefe9c78bb19d644dc91cf0be62d14972756b64 Mon Sep 17 00:00:00 2001 From: ZhuBaohe Date: Fri, 23 Feb 2018 07:09:07 +0800 Subject: [PATCH 3/4] modify the sentence --- pandas/core/generic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e5f7b7ceec673..f768c59652411 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7867,8 +7867,9 @@ def _doc_parms(cls): .. versionadded :: 0.22.0 - Added with the default being 0. This means the sum or product - of an all-NA or empty series is 0 and 1, respectively. + Added with the default being 0. This means the sum of an all-NA + or empty Series is 0, and the product of an all-NA or empty + Series is 1. """ From 22fd6bb4674979da5a7b6626b93fbae80a8c649c Mon Sep 17 00:00:00 2001 From: ZhuBaohe Date: Fri, 23 Feb 2018 07:16:28 +0800 Subject: [PATCH 4/4] fixed for PEP8 --- 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 f768c59652411..85e2ce475ffa2 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7867,8 +7867,8 @@ def _doc_parms(cls): .. versionadded :: 0.22.0 - Added with the default being 0. This means the sum of an all-NA - or empty Series is 0, and the product of an all-NA or empty + Added with the default being 0. This means the sum of an all-NA + or empty Series is 0, and the product of an all-NA or empty Series is 1. """