diff --git a/pandas/core/frame.py b/pandas/core/frame.py index bcba7c8c13f8c..c7c6dd32ed242 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -9562,17 +9562,8 @@ def _gotitem( # TODO: _shallow_copy(subset)? return subset[key] - _agg_summary_and_see_also_doc = dedent( + _agg_see_also_doc = dedent( """ - The aggregation operations are always performed over an axis, either the - index (default) or the column axis. This behavior is different from - `numpy` aggregation functions (`mean`, `median`, `prod`, `sum`, `std`, - `var`), where the default is to compute the aggregation of the flattened - array, e.g., ``numpy.mean(arr_2d)`` as opposed to - ``numpy.mean(arr_2d, axis=0)``. - - `agg` is an alias for `aggregate`. Use the alias. - See Also -------- DataFrame.apply : Perform any type of operations. @@ -9635,7 +9626,7 @@ def _gotitem( _shared_docs["aggregate"], klass=_shared_doc_kwargs["klass"], axis=_shared_doc_kwargs["axis"], - see_also=_agg_summary_and_see_also_doc, + see_also=_agg_see_also_doc, examples=_agg_examples_doc, ) def aggregate(self, func=None, axis: Axis = 0, *args, **kwargs): diff --git a/pandas/core/shared_docs.py b/pandas/core/shared_docs.py index f421ba448c97a..6d35bfef0d780 100644 --- a/pandas/core/shared_docs.py +++ b/pandas/core/shared_docs.py @@ -39,6 +39,13 @@ {see_also} Notes ----- +The aggregation operations are always performed over an axis, either the +index (default) or the column axis. This behavior is different from +`numpy` aggregation functions (`mean`, `median`, `prod`, `sum`, `std`, +`var`), where the default is to compute the aggregation of the flattened +array, e.g., ``numpy.mean(arr_2d)`` as opposed to +``numpy.mean(arr_2d, axis=0)``. + `agg` is an alias for `aggregate`. Use the alias. Functions that mutate the passed object can produce unexpected