From 1a7247adbff6fcfc7263224bb7fc31fffb387e55 Mon Sep 17 00:00:00 2001 From: Krishna Date: Tue, 23 Oct 2018 15:57:57 +0100 Subject: [PATCH 01/22] DOC: Added multi-indexed example for series.max --- pandas/core/generic.py | 44 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 31b700abcfdb3..ea31fcdf2cb86 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9362,7 +9362,7 @@ def compound(self, axis=None, skipna=None, level=None): """This method returns the maximum of the values in the object. If you want the *index* of the maximum, use ``idxmax``. This is the equivalent of the ``numpy.ndarray`` method ``argmax``.""", - nanops.nanmax) + nanops.nanmax, _max_examples) cls.min = _make_stat_function( cls, 'min', name, name2, axis_descr, """This method returns the minimum of the values in the object. @@ -10210,6 +10210,44 @@ def _doc_parms(cls): nan """ +_max_examples = """\ +Examples +-------- +``MultiIndex`` series example of monthly rainfall + +>>> index = [np.tile(['London', 'New York'], 3), +... np.repeat(['Jun', 'Jul', 'Aug'], 2)] +>>> s = pd.Series([47, 112, 35, 117, 54, 113], index=index) +>>> s.rename_axis(['city', 'month'], inplace=True) +>>> s +city month +London Jun 47 +New York Jun 112 +London Jul 35 +New York Jul 117 +London Aug 54 +New York Aug 113 +dtype: int64 + +>>> s.max() +117 + +Sum using level names, as well as indices + +>>> s.max(level='city') +city +London 54 +New York 117 +dtype: int64 + +>>> s.max(level=1) +month +Jun 112 +Jul 117 +Aug 113 +dtype: int64 +""" + _min_count_stub = """\ min_count : int, default 0 @@ -10247,9 +10285,9 @@ def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None, return set_function_name(stat_func, name, cls) -def _make_stat_function(cls, name, name1, name2, axis_descr, desc, f): +def _make_stat_function(cls, name, name1, name2, axis_descr, desc, f, examples=''): @Substitution(outname=name, desc=desc, name1=name1, name2=name2, - axis_descr=axis_descr, min_count='', examples='') + axis_descr=axis_descr, min_count='', examples=examples) @Appender(_num_doc) def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): From 29f788753ed648305de22005980c889415b7a838 Mon Sep 17 00:00:00 2001 From: Krishna Date: Tue, 23 Oct 2018 16:02:12 +0100 Subject: [PATCH 02/22] DOC: truncated line for PEP compliance --- pandas/core/generic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ea31fcdf2cb86..65aca38a809ed 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10285,7 +10285,8 @@ def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None, return set_function_name(stat_func, name, cls) -def _make_stat_function(cls, name, name1, name2, axis_descr, desc, f, examples=''): +def _make_stat_function(cls, name, name1, name2, axis_descr, desc, f, + examples=''): @Substitution(outname=name, desc=desc, name1=name1, name2=name2, axis_descr=axis_descr, min_count='', examples=examples) @Appender(_num_doc) From ae6aadfe9a2387556337bd0f374e69519f1cfc11 Mon Sep 17 00:00:00 2001 From: Krishna Date: Wed, 24 Oct 2018 20:37:36 +0100 Subject: [PATCH 03/22] DOC: Added Examples for Series Min --- pandas/core/generic.py | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 65aca38a809ed..3f1ce70d03cb4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9368,7 +9368,7 @@ def compound(self, axis=None, skipna=None, level=None): """This method returns the minimum of the values in the object. If you want the *index* of the minimum, use ``idxmin``. This is the equivalent of the ``numpy.ndarray`` method ``argmin``.""", - nanops.nanmin) + nanops.nanmin, _min_examples) @classmethod def _add_series_only_operations(cls): @@ -10248,6 +10248,43 @@ def _doc_parms(cls): dtype: int64 """ +_min_examples = """\ +Examples +-------- +``MultiIndex`` series example of monthly rainfall + +>>> index = [np.tile(['London', 'New York'], 3), +... np.repeat(['Jun', 'Jul', 'Aug'], 2)] +>>> s = pd.Series([47, 112, 35, 117, 54, 113], index=index) +>>> s.rename_axis(['city', 'month'], inplace=True) +>>> s +city month +London Jun 47 +New York Jun 112 +London Jul 35 +New York Jul 117 +London Aug 54 +New York Aug 113 +dtype: int64 + +>>> s.min() +35 + +Sum using level names, as well as indices + +>>> s.min(level='city') +city +London 35 +New York 112 +dtype: int64 + +>>> s.min(level=1) +month +Jun 47 +Jul 35 +Aug 54 +dtype: int64 +""" _min_count_stub = """\ min_count : int, default 0 From c16f48be4b0ac0e5a6e2ce71d35d84e990e0a2a2 Mon Sep 17 00:00:00 2001 From: Krishna Date: Thu, 25 Oct 2018 14:07:27 +0100 Subject: [PATCH 04/22] DOC: Typo corrected. --- 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 3f1ce70d03cb4..79889fce737d6 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10232,7 +10232,7 @@ def _doc_parms(cls): >>> s.max() 117 -Sum using level names, as well as indices +Max using level names, as well as indices >>> s.max(level='city') city @@ -10270,7 +10270,7 @@ def _doc_parms(cls): >>> s.min() 35 -Sum using level names, as well as indices +Min using level names, as well as indices >>> s.min(level='city') city From 260790df5037557027f5c42613985b06045808db Mon Sep 17 00:00:00 2001 From: Krishna Date: Thu, 25 Oct 2018 15:09:34 +0100 Subject: [PATCH 05/22] DOC: Restructured indexing as requested. --- pandas/core/generic.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 79889fce737d6..06a17bc94dc2d 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10253,10 +10253,11 @@ def _doc_parms(cls): -------- ``MultiIndex`` series example of monthly rainfall ->>> index = [np.tile(['London', 'New York'], 3), -... np.repeat(['Jun', 'Jul', 'Aug'], 2)] +>>> index = pd.MultiIndex.from_arrays( +... [np.tile(['London', 'New York'], 3), +... np.repeat(['Jun', 'Jul', 'Aug'], 2)], +... names=['city', 'month']) >>> s = pd.Series([47, 112, 35, 117, 54, 113], index=index) ->>> s.rename_axis(['city', 'month'], inplace=True) >>> s city month London Jun 47 From ad975020e73014b63544cc1b7a5995d579cc695d Mon Sep 17 00:00:00 2001 From: Krishna Date: Thu, 25 Oct 2018 16:25:41 +0100 Subject: [PATCH 06/22] DOC: Switched from MultiIndex.from_arrays to MultiIndex.from_product --- pandas/core/generic.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 06a17bc94dc2d..8089053c1a2aa 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10253,19 +10253,18 @@ def _doc_parms(cls): -------- ``MultiIndex`` series example of monthly rainfall ->>> index = pd.MultiIndex.from_arrays( -... [np.tile(['London', 'New York'], 3), -... np.repeat(['Jun', 'Jul', 'Aug'], 2)], -... names=['city', 'month']) ->>> s = pd.Series([47, 112, 35, 117, 54, 113], index=index) +>>> index = pd.MultiIndex.from_product( +... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], +... names=['city', 'month']) +>>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) >>> s city month London Jun 47 + Jul 35 + Aug 54 New York Jun 112 -London Jul 35 -New York Jul 117 -London Aug 54 -New York Aug 113 + Jul 117 + Aug 113 dtype: int64 >>> s.min() From 5084c318a98238b9472eb88577227156a143edb1 Mon Sep 17 00:00:00 2001 From: Krishna Date: Thu, 25 Oct 2018 22:15:38 +0100 Subject: [PATCH 07/22] Merge branch 'master' of github.com:pandas-dev/pandas into series-min # Conflicts: # pandas/core/generic.py --- pandas/core/generic.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0c703cbe5d6ee..8dab361b321cc 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10267,44 +10267,6 @@ def _doc_parms(cls): dtype: int64 """ -_max_examples = """\ -Examples --------- -``MultiIndex`` series example of monthly rainfall - ->>> index = [np.tile(['London', 'New York'], 3), -... np.repeat(['Jun', 'Jul', 'Aug'], 2)] ->>> s = pd.Series([47, 112, 35, 117, 54, 113], index=index) ->>> s.rename_axis(['city', 'month'], inplace=True) ->>> s -city month -London Jun 47 -New York Jun 112 -London Jul 35 -New York Jul 117 -London Aug 54 -New York Aug 113 -dtype: int64 - ->>> s.max() -117 - -Max using level names, as well as indices - ->>> s.max(level='city') -city -London 54 -New York 117 -dtype: int64 - ->>> s.max(level=1) -month -Jun 112 -Jul 117 -Aug 113 -dtype: int64 -""" - _min_examples = """\ Examples -------- From 6ac044df0c851da6aa1b38f2766360584491bc36 Mon Sep 17 00:00:00 2001 From: Krishna Date: Thu, 25 Oct 2018 22:21:35 +0100 Subject: [PATCH 08/22] Formatting Indentation for PEP compliance --- 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 8dab361b321cc..f615d477ecc5b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10273,8 +10273,8 @@ def _doc_parms(cls): ``MultiIndex`` series example of monthly rainfall >>> index = pd.MultiIndex.from_product( -... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], -... names=['city', 'month']) +... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], +... names=['city', 'month']) >>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) >>> s city month From 8b4fd1d8ef267173e98bd273903df4fbf3cbe452 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sun, 28 Oct 2018 11:29:45 +0000 Subject: [PATCH 09/22] DOC: Initial templating of stat_func multiIndex examples --- pandas/core/generic.py | 127 ++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 83 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index aa3492ddf6823..69a91df4a255e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10182,16 +10182,34 @@ def _doc_parms(cls): Series([], dtype: bool) """ -_sum_examples = """\ -Examples --------- -``MultiIndex`` series example of monthly rainfall + +def _multi_index_example(stat_func, default_output, named_level_output, + indexed_level_output): + """ + Template for creating a ``MultiIndex`` series example for stat functions. + + Parameters + ---------- + stat_func : str + The stat function to have the examples generated for. + default_output : int, float or str + Formatted output produced by the stat function with no arguments. + named_level_output : tuple of (int or float or str,) + Formatted outputs of executing the stat method with arg level='city'. + indexed_level_output : tuple of (int or float or str,) + Formatted outputs of executing the stat method with arg level=1. + + Returns + ------- + str + A templated string for the Examples section. + """ + return f"""``MultiIndex`` series example of monthly rainfall >>> index = pd.MultiIndex.from_product( ... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], ... names=['city', 'month']) >>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) ->>> s city month London Jun 47 Jul 35 @@ -10201,23 +10219,30 @@ def _doc_parms(cls): Aug 113 dtype: int64 ->>> s.sum() -478 +>>> s.{stat_func}() +{default_output} -Sum using level names, as well as indices +{stat_func.capitalize()} using level names, as well as indices. ->>> s.sum(level='city') +>>> s.{stat_func}(level='city') city -London 136 -New York 342 +London {named_level_output[0]} +New York {named_level_output[1]} dtype: int64 ->>> s.sum(level=1) +>>> s.{stat_func}(level=1) month -Jun 159 -Jul 152 -Aug 167 +Jun {indexed_level_output[0]} +Jul {indexed_level_output[1]} +Aug {indexed_level_output[2]} dtype: int64 +""" + + +_sum_examples = f"""\ +Examples +-------- +{_multi_index_example('sum', 478, (136, 342), (159, 152, 167))} By default, the sum of an empty or all-NA Series is ``0``. @@ -10263,80 +10288,16 @@ def _doc_parms(cls): nan """ -_max_examples = """\ +_max_examples = f"""\ Examples -------- -``MultiIndex`` series example of monthly rainfall - ->>> index = pd.MultiIndex.from_product( -... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], -... names=['city', 'month']) ->>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) ->>> s -city month -London Jun 47 - Jul 35 - Aug 54 -New York Jun 112 - Jul 117 - Aug 113 -dtype: int64 - ->>> s.max() -117 - -Max using level names, as well as indices - ->>> s.max(level='city') -city -London 54 -New York 117 -dtype: int64 - ->>> s.max(level=1) -month -Jun 112 -Jul 117 -Aug 113 -dtype: int64 +{_multi_index_example('max', 117, (' 54', 117), (112, 117, 113))} """ -_min_examples = """\ +_min_examples = f"""\ Examples -------- -``MultiIndex`` series example of monthly rainfall - ->>> index = pd.MultiIndex.from_product( -... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], -... names=['city', 'month']) ->>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) ->>> s -city month -London Jun 47 - Jul 35 - Aug 54 -New York Jun 112 - Jul 117 - Aug 113 -dtype: int64 - ->>> s.min() -35 - -Min using level names, as well as indices - ->>> s.min(level='city') -city -London 35 -New York 112 -dtype: int64 - ->>> s.min(level=1) -month -Jun 47 -Jul 35 -Aug 54 -dtype: int64 +{_multi_index_example('min', 35, (' 35', 112), (47, 35, 54))} """ _min_count_stub = """\ From 0a961a49f6efa746025cb80c4d0a506f8d13f0c4 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sun, 4 Nov 2018 14:45:42 +0000 Subject: [PATCH 10/22] DOC: Refactored templating of stat_func multiIndex examples for Python 2.7 --- pandas/core/generic.py | 90 ++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 69a91df4a255e..608edd2f996fa 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10182,29 +10182,8 @@ def _doc_parms(cls): Series([], dtype: bool) """ - -def _multi_index_example(stat_func, default_output, named_level_output, - indexed_level_output): - """ - Template for creating a ``MultiIndex`` series example for stat functions. - - Parameters - ---------- - stat_func : str - The stat function to have the examples generated for. - default_output : int, float or str - Formatted output produced by the stat function with no arguments. - named_level_output : tuple of (int or float or str,) - Formatted outputs of executing the stat method with arg level='city'. - indexed_level_output : tuple of (int or float or str,) - Formatted outputs of executing the stat method with arg level=1. - - Returns - ------- - str - A templated string for the Examples section. - """ - return f"""``MultiIndex`` series example of monthly rainfall +_shared_docs['stat_func_multi_index'] = """ +``MultiIndex`` series example of monthly rainfall >>> index = pd.MultiIndex.from_product( ... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], @@ -10219,30 +10198,52 @@ def _multi_index_example(stat_func, default_output, named_level_output, Aug 113 dtype: int64 ->>> s.{stat_func}() -{default_output} +>>> s.%(stat_func)s() +%(default_output)s -{stat_func.capitalize()} using level names, as well as indices. +%(verb)s using level names, as well as indices. ->>> s.{stat_func}(level='city') +>>> s.%(stat_func)s(level='city') city -London {named_level_output[0]} -New York {named_level_output[1]} +London %(named_level_output_0)s +New York %(named_level_output_1)s dtype: int64 ->>> s.{stat_func}(level=1) +>>> s.%(stat_func)s(level=1) month -Jun {indexed_level_output[0]} -Jul {indexed_level_output[1]} -Aug {indexed_level_output[2]} +Jun %(indexed_level_output_0)s +Jul %(indexed_level_output_1)s +Aug %(indexed_level_output_2)s dtype: int64 """ - - -_sum_examples = f"""\ +_shared_docs['sum_multi_index'] = dict(stat_func='sum', verb='Sum', + default_output='478', + named_level_output_0='136', + named_level_output_1='342', + indexed_level_output_0='159', + indexed_level_output_1='152', + indexed_level_output_2='167') + +_shared_docs['max_multi_index'] = dict(stat_func='max', verb='Maximize', + default_output='117', + named_level_output_0=' 54', + named_level_output_1='117', + indexed_level_output_0='112', + indexed_level_output_1='117', + indexed_level_output_2='113') + +_shared_docs['min_multi_index'] = dict(stat_func='min', verb='Minimize', + default_output='35', + named_level_output_0=' 35', + named_level_output_1='112', + indexed_level_output_0='47', + indexed_level_output_1='35', + indexed_level_output_2='54') + +_sum_examples = """\ Examples -------- -{_multi_index_example('sum', 478, (136, 342), (159, 152, 167))} +%(multi_index_example)s By default, the sum of an empty or all-NA Series is ``0``. @@ -10263,7 +10264,8 @@ def _multi_index_example(stat_func, default_output, named_level_output, >>> pd.Series([np.nan]).sum(min_count=1) nan -""" +""" % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % + _shared_docs['sum_multi_index']) _prod_examples = """\ Examples @@ -10288,17 +10290,19 @@ def _multi_index_example(stat_func, default_output, named_level_output, nan """ -_max_examples = f"""\ +_max_examples = """\ Examples -------- -{_multi_index_example('max', 117, (' 54', 117), (112, 117, 113))} -""" +%(multi_index_example)s +""" % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % + _shared_docs['max_multi_index']) _min_examples = f"""\ Examples -------- -{_multi_index_example('min', 35, (' 35', 112), (47, 35, 54))} -""" +%(multi_index_example)s +""" % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % + _shared_docs['min_multi_index']) _min_count_stub = """\ min_count : int, default 0 From bea2ecd2dfc102d973886171f8c6b31c54e55f7e Mon Sep 17 00:00:00 2001 From: Krishna Date: Sun, 4 Nov 2018 14:57:29 +0000 Subject: [PATCH 11/22] DOC: Removed spurious f --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 608edd2f996fa..3cce2ad93e066 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10297,7 +10297,7 @@ def _doc_parms(cls): """ % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % _shared_docs['max_multi_index']) -_min_examples = f"""\ +_min_examples = """\ Examples -------- %(multi_index_example)s From af16a3b3b394afe1c4036d62131be8cdd73c657f Mon Sep 17 00:00:00 2001 From: Krishna Date: Mon, 5 Nov 2018 16:28:01 +0000 Subject: [PATCH 12/22] DOC: Refactoring for simplicity --- pandas/core/generic.py | 80 ++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index eea0845fd7096..0a3d57f3895b3 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10397,7 +10397,31 @@ def _doc_parms(cls): Series([], dtype: bool) """ -_shared_docs['stat_func_multi_index'] = """ +_sum_na = """ +By default, the sum of an empty or all-NA Series is ``0``. + +>>> pd.Series([]).sum() # min_count=0 is the default +0.0 + +This can be controlled with the ``min_count`` parameter. For example, if +you'd like the sum of an empty series to be NaN, pass ``min_count=1``. + +>>> pd.Series([]).sum(min_count=1) +nan + +Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and +empty series identically. + +>>> pd.Series([np.nan]).sum() +0.0 + +>>> pd.Series([np.nan]).sum(min_count=1) +nan +""" + +_shared_docs['stat_func_example'] = """ +Examples +-------- ``MultiIndex`` series example of monthly rainfall >>> index = pd.MultiIndex.from_product( @@ -10430,6 +10454,7 @@ def _doc_parms(cls): Jul %(indexed_level_output_1)s Aug %(indexed_level_output_2)s dtype: int64 +%(additional)s """ _shared_docs['sum_multi_index'] = dict(stat_func='sum', verb='Sum', default_output='478', @@ -10437,7 +10462,8 @@ def _doc_parms(cls): named_level_output_1='342', indexed_level_output_0='159', indexed_level_output_1='152', - indexed_level_output_2='167') + indexed_level_output_2='167', + additional=_sum_na) _shared_docs['max_multi_index'] = dict(stat_func='max', verb='Maximize', default_output='117', @@ -10445,7 +10471,8 @@ def _doc_parms(cls): named_level_output_1='117', indexed_level_output_0='112', indexed_level_output_1='117', - indexed_level_output_2='113') + indexed_level_output_2='113', + additional=None) _shared_docs['min_multi_index'] = dict(stat_func='min', verb='Minimize', default_output='35', @@ -10453,34 +10480,11 @@ def _doc_parms(cls): named_level_output_1='112', indexed_level_output_0='47', indexed_level_output_1='35', - indexed_level_output_2='54') + indexed_level_output_2='54', + additional=None) -_sum_examples = """\ -Examples --------- -%(multi_index_example)s - -By default, the sum of an empty or all-NA Series is ``0``. - ->>> pd.Series([]).sum() # min_count=0 is the default -0.0 - -This can be controlled with the ``min_count`` parameter. For example, if -you'd like the sum of an empty series to be NaN, pass ``min_count=1``. - ->>> pd.Series([]).sum(min_count=1) -nan - -Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and -empty series identically. - ->>> pd.Series([np.nan]).sum() -0.0 - ->>> pd.Series([np.nan]).sum(min_count=1) -nan -""" % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % - _shared_docs['sum_multi_index']) +_sum_examples = _shared_docs['stat_func_example'] % \ + _shared_docs['sum_multi_index'] _prod_examples = """\ Examples @@ -10505,19 +10509,11 @@ def _doc_parms(cls): nan """ -_max_examples = """\ -Examples --------- -%(multi_index_example)s -""" % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % - _shared_docs['max_multi_index']) +_max_examples = _shared_docs['stat_func_example'] % \ + _shared_docs['max_multi_index'] -_min_examples = """\ -Examples --------- -%(multi_index_example)s -""" % dict(multi_index_example=_shared_docs['stat_func_multi_index'] % - _shared_docs['min_multi_index']) +_min_examples = _shared_docs['stat_func_example'] % \ + _shared_docs['min_multi_index'] _min_count_stub = """\ min_count : int, default 0 From 23ed6b8155af585aeacde9ee8c6192a49fdd985d Mon Sep 17 00:00:00 2001 From: Krishna Date: Mon, 5 Nov 2018 20:20:57 +0000 Subject: [PATCH 13/22] DOC: Corrected None to empty string --- 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 0a3d57f3895b3..90f8a483f8060 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10472,7 +10472,7 @@ def _doc_parms(cls): indexed_level_output_0='112', indexed_level_output_1='117', indexed_level_output_2='113', - additional=None) + additional='') _shared_docs['min_multi_index'] = dict(stat_func='min', verb='Minimize', default_output='35', @@ -10481,7 +10481,7 @@ def _doc_parms(cls): indexed_level_output_0='47', indexed_level_output_1='35', indexed_level_output_2='54', - additional=None) + additional='') _sum_examples = _shared_docs['stat_func_example'] % \ _shared_docs['sum_multi_index'] From 12f3d9d94b9a5a783ef6c062501c57d95f35ce32 Mon Sep 17 00:00:00 2001 From: Krishna Date: Mon, 5 Nov 2018 21:07:38 +0000 Subject: [PATCH 14/22] DOC: Formatting --- 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 90f8a483f8060..be43b20ada2c1 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10419,7 +10419,7 @@ def _doc_parms(cls): nan """ -_shared_docs['stat_func_example'] = """ +_shared_docs['stat_func_example'] = """\ Examples -------- ``MultiIndex`` series example of monthly rainfall @@ -10454,8 +10454,8 @@ def _doc_parms(cls): Jul %(indexed_level_output_1)s Aug %(indexed_level_output_2)s dtype: int64 -%(additional)s -""" +%(additional)s""" + _shared_docs['sum_multi_index'] = dict(stat_func='sum', verb='Sum', default_output='478', named_level_output_0='136', From 24245217f10d4319c00f87e0dbd9df8f2c1469f2 Mon Sep 17 00:00:00 2001 From: Krishna Date: Tue, 6 Nov 2018 13:19:18 +0000 Subject: [PATCH 15/22] DOC: Corrected example output --- pandas/core/generic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index be43b20ada2c1..c69a5172b5494 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10428,6 +10428,7 @@ def _doc_parms(cls): ... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], ... names=['city', 'month']) >>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) +>>> s city month London Jun 47 Jul 35 From 77c866eba9f739b9ac644f8502e469a80cf2a7b3 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sat, 1 Dec 2018 10:54:23 +0000 Subject: [PATCH 16/22] DOC: Updated stat func base example --- pandas/core/generic.py | 48 +++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index c69a5172b5494..f7edca37a2395 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10422,40 +10422,36 @@ def _doc_parms(cls): _shared_docs['stat_func_example'] = """\ Examples -------- -``MultiIndex`` series example of monthly rainfall +``MultiIndex`` series example. ->>> index = pd.MultiIndex.from_product( -... [['London', 'New York'], ['Jun', 'Jul', 'Aug']], -... names=['city', 'month']) ->>> s = pd.Series([47, 35, 54, 112, 117, 113], index=index) +>>> index = pd.MultiIndex.from_arrays( +... [['Warm', 'Warm', 'Cold', 'Cold'], ['Dog', 'Falcon', 'Fish', 'Spider']], +... names=['Blooded', 'Animal']) +>>> s = pd.Series([4, 2, 0, 8], name='Legs', index=index) >>> s -city month -London Jun 47 - Jul 35 - Aug 54 -New York Jun 112 - Jul 117 - Aug 113 -dtype: int64 +Blooded Animal +Warm Dog 4 + Falcon 2 +Cold Fish 0 + Spider 8 +Name: Legs, dtype: int64 >>> s.%(stat_func)s() %(default_output)s %(verb)s using level names, as well as indices. ->>> s.%(stat_func)s(level='city') -city -London %(named_level_output_0)s -New York %(named_level_output_1)s -dtype: int64 - ->>> s.%(stat_func)s(level=1) -month -Jun %(indexed_level_output_0)s -Jul %(indexed_level_output_1)s -Aug %(indexed_level_output_2)s -dtype: int64 -%(additional)s""" +>>> s.%(stat_func)s(level='Blooded') +Blooded +Warm %(named_level_output_0)s +Cold %(named_level_output_1)s +Name: Legs, dtype: int64 + +>>> s.%(stat_func)s(level=0) +Blooded +Warm %(level_output_0)s +Cold %(level_output_1)s +Name: Legs, dtype: int64""" _shared_docs['sum_multi_index'] = dict(stat_func='sum', verb='Sum', default_output='478', From aa2d2285fdfda50e705e362d28801d4acd0ec681 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sat, 1 Dec 2018 11:38:03 +0000 Subject: [PATCH 17/22] DOC: Updated stat func sum, min and max examples for clarity. --- pandas/core/generic.py | 113 ++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 63 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f7edca37a2395..d474fa07c6f2d 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10397,35 +10397,14 @@ def _doc_parms(cls): Series([], dtype: bool) """ -_sum_na = """ -By default, the sum of an empty or all-NA Series is ``0``. - ->>> pd.Series([]).sum() # min_count=0 is the default -0.0 - -This can be controlled with the ``min_count`` parameter. For example, if -you'd like the sum of an empty series to be NaN, pass ``min_count=1``. - ->>> pd.Series([]).sum(min_count=1) -nan - -Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and -empty series identically. - ->>> pd.Series([np.nan]).sum() -0.0 - ->>> pd.Series([np.nan]).sum(min_count=1) -nan -""" - _shared_docs['stat_func_example'] = """\ Examples -------- ``MultiIndex`` series example. ->>> index = pd.MultiIndex.from_arrays( -... [['Warm', 'Warm', 'Cold', 'Cold'], ['Dog', 'Falcon', 'Fish', 'Spider']], +>>> index = pd.MultiIndex.from_arrays([ +... ['Warm', 'Warm', 'Cold', 'Cold'], +... ['Dog', 'Falcon', 'Fish', 'Spider']], ... names=['Blooded', 'Animal']) >>> s = pd.Series([4, 2, 0, 8], name='Legs', index=index) >>> s @@ -10443,45 +10422,59 @@ def _doc_parms(cls): >>> s.%(stat_func)s(level='Blooded') Blooded -Warm %(named_level_output_0)s -Cold %(named_level_output_1)s +Warm %(level_output_0)s +Cold %(level_output_1)s Name: Legs, dtype: int64 >>> s.%(stat_func)s(level=0) Blooded Warm %(level_output_0)s Cold %(level_output_1)s -Name: Legs, dtype: int64""" - -_shared_docs['sum_multi_index'] = dict(stat_func='sum', verb='Sum', - default_output='478', - named_level_output_0='136', - named_level_output_1='342', - indexed_level_output_0='159', - indexed_level_output_1='152', - indexed_level_output_2='167', - additional=_sum_na) - -_shared_docs['max_multi_index'] = dict(stat_func='max', verb='Maximize', - default_output='117', - named_level_output_0=' 54', - named_level_output_1='117', - indexed_level_output_0='112', - indexed_level_output_1='117', - indexed_level_output_2='113', - additional='') - -_shared_docs['min_multi_index'] = dict(stat_func='min', verb='Minimize', - default_output='35', - named_level_output_0=' 35', - named_level_output_1='112', - indexed_level_output_0='47', - indexed_level_output_1='35', - indexed_level_output_2='54', - additional='') - -_sum_examples = _shared_docs['stat_func_example'] % \ - _shared_docs['sum_multi_index'] +Name: Legs, dtype: int64 +""" + +_sum_examples = _shared_docs['stat_func_example'] % dict( + stat_func='sum', + verb='Sum', + default_output=14, + level_output_0=6, + level_output_1=8) + +_sum_examples += """ +By default, the sum of an empty or all-NA Series is ``0``. + +>>> pd.Series([]).sum() # min_count=0 is the default +0.0 + +This can be controlled with the ``min_count`` parameter. For example, if +you'd like the sum of an empty series to be NaN, pass ``min_count=1``. + +>>> pd.Series([]).sum(min_count=1) +nan + +Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and +empty series identically. + +>>> pd.Series([np.nan]).sum() +0.0 + +>>> pd.Series([np.nan]).sum(min_count=1) +nan +""" + +_max_examples = _shared_docs['stat_func_example'] % dict( + stat_func='max', + verb='Max', + default_output=8, + level_output_0=4, + level_output_1=8) + +_min_examples = _shared_docs['stat_func_example'] % dict( + stat_func='min', + verb='Min', + default_output=0, + level_output_0=2, + level_output_1=0) _prod_examples = """\ Examples @@ -10506,12 +10499,6 @@ def _doc_parms(cls): nan """ -_max_examples = _shared_docs['stat_func_example'] % \ - _shared_docs['max_multi_index'] - -_min_examples = _shared_docs['stat_func_example'] % \ - _shared_docs['min_multi_index'] - _min_count_stub = """\ min_count : int, default 0 The required number of valid values to perform the operation. If fewer than From 48e7dfc77d4542889d7d30d23e0b61b812c1cd83 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sat, 1 Dec 2018 13:34:14 +0000 Subject: [PATCH 18/22] DOC: Updated string variables from old format -> new. --- pandas/core/generic.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d474fa07c6f2d..592a81fb2a847 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10415,25 +10415,25 @@ def _doc_parms(cls): Spider 8 Name: Legs, dtype: int64 ->>> s.%(stat_func)s() -%(default_output)s +>>> s.{stat_func}() +{default_output} -%(verb)s using level names, as well as indices. +{verb} using level names, as well as indices. ->>> s.%(stat_func)s(level='Blooded') +>>> s.{stat_func}(level='Blooded') Blooded -Warm %(level_output_0)s -Cold %(level_output_1)s +Warm {level_output_0} +Cold {level_output_1} Name: Legs, dtype: int64 ->>> s.%(stat_func)s(level=0) +>>> s.{stat_func}(level=0) Blooded -Warm %(level_output_0)s -Cold %(level_output_1)s +Warm {level_output_0} +Cold {level_output_1} Name: Legs, dtype: int64 """ -_sum_examples = _shared_docs['stat_func_example'] % dict( +_sum_examples = _shared_docs['stat_func_example'].format( stat_func='sum', verb='Sum', default_output=14, @@ -10462,14 +10462,14 @@ def _doc_parms(cls): nan """ -_max_examples = _shared_docs['stat_func_example'] % dict( +_max_examples = _shared_docs['stat_func_example'].format( stat_func='max', verb='Max', default_output=8, level_output_0=4, level_output_1=8) -_min_examples = _shared_docs['stat_func_example'] % dict( +_min_examples = _shared_docs['stat_func_example'].format( stat_func='min', verb='Min', default_output=0, From aeba7489aadd3d16947c29b927ecbca0af3991ac Mon Sep 17 00:00:00 2001 From: Krishna Date: Sun, 2 Dec 2018 22:21:40 +0000 Subject: [PATCH 19/22] DOC: Formatting update. --- pandas/core/generic.py | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 592a81fb2a847..66d0f8bae949f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10400,37 +10400,36 @@ def _doc_parms(cls): _shared_docs['stat_func_example'] = """\ Examples -------- -``MultiIndex`` series example. ->>> index = pd.MultiIndex.from_arrays([ -... ['Warm', 'Warm', 'Cold', 'Cold'], -... ['Dog', 'Falcon', 'Fish', 'Spider']], -... names=['Blooded', 'Animal']) ->>> s = pd.Series([4, 2, 0, 8], name='Legs', index=index) +>>> idx = pd.MultiIndex.from_arrays([ +... ['warm', 'warm', 'cold', 'cold'], +... ['dog', 'falcon', 'fish', 'spider']], +... names=['blooded', 'animal']) +>>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx) >>> s -Blooded Animal -Warm Dog 4 - Falcon 2 -Cold Fish 0 - Spider 8 -Name: Legs, dtype: int64 +blooded animal +warm dog 4 + falcon 2 +cold fish 0 + spider 8 +Name: legs, dtype: int64 >>> s.{stat_func}() {default_output} {verb} using level names, as well as indices. ->>> s.{stat_func}(level='Blooded') -Blooded -Warm {level_output_0} -Cold {level_output_1} -Name: Legs, dtype: int64 +>>> s.{stat_func}(level='blooded') +blooded +warm {level_output_0} +cold {level_output_1} +Name: legs, dtype: int64 >>> s.{stat_func}(level=0) -Blooded -Warm {level_output_0} -Cold {level_output_1} -Name: Legs, dtype: int64 +blooded +warm {level_output_0} +cold {level_output_1} +Name: legs, dtype: int64 """ _sum_examples = _shared_docs['stat_func_example'].format( From c230c3b019515e90e7a899eaf36fa05ff81a87e4 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sun, 2 Dec 2018 23:45:02 +0000 Subject: [PATCH 20/22] DOC: Updated sum, min & max for complete doc string compliance. --- pandas/core/generic.py | 62 ++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 66d0f8bae949f..fe8918a845dc8 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9495,7 +9495,7 @@ def _add_numeric_operations(cls): desc="Return the mean absolute deviation of the values " "for the requested axis", name1=name, name2=name2, axis_descr=axis_descr, - min_count='', examples='') + min_count='', see_also='', examples='') @Appender(_num_doc) def mad(self, axis=None, skipna=None, level=None): if skipna is None: @@ -9537,7 +9537,7 @@ def mad(self, axis=None, skipna=None, level=None): desc="Return the compound percentage of the values for " "the requested axis", name1=name, name2=name2, axis_descr=axis_descr, - min_count='', examples='') + min_count='', see_also='', examples='') @Appender(_num_doc) def compound(self, axis=None, skipna=None, level=None): if skipna is None: @@ -9565,8 +9565,9 @@ def compound(self, axis=None, skipna=None, level=None): cls.sum = _make_min_count_stat_function( cls, 'sum', name, name2, axis_descr, - 'Return the sum of the values for the requested axis', - nanops.nansum, _sum_examples) + """Return the sum of the values for the requested axis.\n + This is equivalent to the method ``numpy.sum``.""", + nanops.nansum, _sum_examples, _stat_func_see_also) cls.mean = _make_stat_function( cls, 'mean', name, name2, axis_descr, 'Return the mean of the values for the requested axis', @@ -9593,16 +9594,16 @@ def compound(self, axis=None, skipna=None, level=None): nanops.nanmedian) cls.max = _make_stat_function( cls, 'max', name, name2, axis_descr, - """This method returns the maximum of the values in the object. + """Return the maximum of the values for the requested axis.\n If you want the *index* of the maximum, use ``idxmax``. This is the equivalent of the ``numpy.ndarray`` method ``argmax``.""", - nanops.nanmax, _max_examples) + nanops.nanmax, _max_examples, _stat_func_see_also) cls.min = _make_stat_function( cls, 'min', name, name2, axis_descr, - """This method returns the minimum of the values in the object. + """Return the minimum of the values for the requested axis.\n If you want the *index* of the minimum, use ``idxmin``. This is the equivalent of the ``numpy.ndarray`` method ``argmin``.""", - nanops.nanmin, _min_examples) + nanops.nanmin, _min_examples, _stat_func_see_also) @classmethod def _add_series_only_operations(cls): @@ -9893,27 +9894,30 @@ def _doc_parms(cls): _num_doc = """ - %(desc)s Parameters ---------- axis : %(axis_descr)s -skipna : boolean, default True + Axis for the function to be applied on. +skipna : bool, default True Exclude NA/null values when computing the result. level : int or level name, default None If the axis is a MultiIndex (hierarchical), count along a - particular level, collapsing into a %(name1)s -numeric_only : boolean, default None + particular level, collapsing into a %(name1)s. +numeric_only : bool, default None Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data. Not implemented for Series. %(min_count)s\ +**kwargs + Additional keyword arguments to be passed to the function. Returns ------- %(outname)s : %(name1)s or %(name2)s (if level specified) - -%(examples)s""" +%(see_also)s +%(examples)s\ +""" _num_ddof_doc = """ @@ -10397,7 +10401,7 @@ def _doc_parms(cls): Series([], dtype: bool) """ -_shared_docs['stat_func_example'] = """\ +_shared_docs['stat_func_example'] = """ Examples -------- @@ -10475,6 +10479,21 @@ def _doc_parms(cls): level_output_0=2, level_output_1=0) +_stat_func_see_also = """\ +See Also +-------- +Series.sum : Return the sum. +Series.min : Return the minimum. +Series.max : Return the maximum. +Series.idxmin : Return the index of the minimum. +Series.idxmax : Return the index of the maximum. +DataFrame.min : Return the sum over the requested axis. +DataFrame.min : Return the minimum over the requested axis. +DataFrame.max : Return the maximum over the requested axis. +DataFrame.idxmin : Return the index of the minimum over the requested axis. +DataFrame.idxmax : Return the index of the maximum over the requested axis. +""" + _prod_examples = """\ Examples -------- @@ -10512,10 +10531,10 @@ def _doc_parms(cls): def _make_min_count_stat_function(cls, name, name1, name2, axis_descr, desc, - f, examples): + f, see_also='', examples=''): @Substitution(outname=name, desc=desc, name1=name1, name2=name2, axis_descr=axis_descr, min_count=_min_count_stub, - examples=examples) + see_also=see_also, examples=examples) @Appender(_num_doc) def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None, min_count=0, @@ -10535,9 +10554,10 @@ def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None, def _make_stat_function(cls, name, name1, name2, axis_descr, desc, f, - examples=''): + see_also='', examples=''): @Substitution(outname=name, desc=desc, name1=name1, name2=name2, - axis_descr=axis_descr, min_count='', examples=examples) + axis_descr=axis_descr, min_count='', see_also=see_also, + examples=examples) @Appender(_num_doc) def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): @@ -10611,9 +10631,9 @@ def cum_func(self, axis=None, skipna=True, *args, **kwargs): def _make_logical_function(cls, name, name1, name2, axis_descr, desc, f, - examples, see_also): + see_also, examples): @Substitution(outname=name, desc=desc, name1=name1, name2=name2, - axis_descr=axis_descr, examples=examples, see_also=see_also) + axis_descr=axis_descr, see_also=see_also, examples=examples) @Appender(_bool_doc) def logical_func(self, axis=0, bool_only=None, skipna=True, level=None, **kwargs): From d612e7ce2d01242fac838c3faa98e0208f51572e Mon Sep 17 00:00:00 2001 From: Krishna Date: Mon, 3 Dec 2018 00:24:12 +0000 Subject: [PATCH 21/22] Merge branch 'master' of github.com:pandas-dev/pandas into series-min # Conflicts: # pandas/core/generic.py --- pandas/core/generic.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 7b77c38845489..c8ecf0b05711f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9944,7 +9944,7 @@ def compound(self, axis=None, skipna=None, level=None): cls, 'sum', name, name2, axis_descr, """Return the sum of the values for the requested axis.\n This is equivalent to the method ``numpy.sum``.""", - nanops.nansum, _sum_examples, _stat_func_see_also) + nanops.nansum, _stat_func_see_also, _sum_examples) cls.mean = _make_stat_function( cls, 'mean', name, name2, axis_descr, 'Return the mean of the values for the requested axis', @@ -9963,7 +9963,7 @@ def compound(self, axis=None, skipna=None, level=None): cls.prod = _make_min_count_stat_function( cls, 'prod', name, name2, axis_descr, 'Return the product of the values for the requested axis', - nanops.nanprod, _prod_examples) + nanops.nanprod, examples=_prod_examples) cls.product = cls.prod cls.median = _make_stat_function( cls, 'median', name, name2, axis_descr, @@ -9974,13 +9974,13 @@ def compound(self, axis=None, skipna=None, level=None): """Return the maximum of the values for the requested axis.\n If you want the *index* of the maximum, use ``idxmax``. This is the equivalent of the ``numpy.ndarray`` method ``argmax``.""", - nanops.nanmax, _max_examples, _stat_func_see_also) + nanops.nanmax, _stat_func_see_also, _max_examples) cls.min = _make_stat_function( cls, 'min', name, name2, axis_descr, """Return the minimum of the values for the requested axis.\n If you want the *index* of the minimum, use ``idxmin``. This is the equivalent of the ``numpy.ndarray`` method ``argmin``.""", - nanops.nanmin, _min_examples, _stat_func_see_also) + nanops.nanmin, _stat_func_see_also, _min_examples) @classmethod def _add_series_only_operations(cls): @@ -10147,7 +10147,7 @@ def _doc_parms(cls): Returns ------- -%(outname)s : %(name1)s or %(name2)s (if level specified)\ +%(outname)s : %(name1)s or %(name2)s (if level specified) %(see_also)s %(examples)s\ """ @@ -10633,7 +10633,7 @@ def _doc_parms(cls): Series([], dtype: bool) """ -_shared_docs['stat_func_example'] = """ +_shared_docs['stat_func_example'] = """\ Examples -------- From 8ec816a64763e9a520c96d0cf201c54ddb37fe84 Mon Sep 17 00:00:00 2001 From: Krishna Date: Sat, 22 Dec 2018 18:21:17 +0000 Subject: [PATCH 22/22] Merge branch 'master' of github.com:pandas-dev/pandas into series-min # Conflicts: # pandas/core/generic.py --- 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 ca1f659062e0f..63d9b5265cdc7 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9905,10 +9905,10 @@ def _add_numeric_operations(cls): cls.any = _make_logical_function( cls, 'any', name, name2, axis_descr, _any_desc, nanops.nanany, - _any_examples, _any_see_also, empty_value=False) + _any_see_also, _any_examples, empty_value=False) cls.all = _make_logical_function( cls, 'all', name, name2, axis_descr, _all_desc, nanops.nanall, - _all_examples, _all_see_also, empty_value=True) + _all_see_also, _all_examples, empty_value=True) @Substitution(outname='mad', desc="Return the mean absolute deviation of the values " @@ -10937,7 +10937,7 @@ def cum_func(self, axis=None, skipna=True, *args, **kwargs): def _make_logical_function(cls, name, name1, name2, axis_descr, desc, f, see_also, examples, empty_value): @Substitution(outname=name, desc=desc, name1=name1, name2=name2, - axis_descr=axis_descr, see_also=see_also, examples=examples) + axis_descr=axis_descr, see_also=see_also, examples=examples, empty_value=empty_value) @Appender(_bool_doc) def logical_func(self, axis=0, bool_only=None, skipna=True, level=None,