Skip to content

Commit dfbf8e9

Browse files
committed
improve doc string for df.aggregate and df.transform
1 parent 996f361 commit dfbf8e9

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

pandas/core/generic.py

+20-12
Original file line numberDiff line numberDiff line change
@@ -4545,17 +4545,16 @@ def pipe(self, func, *args, **kwargs):
45454545
45464546
Parameters
45474547
----------
4548-
func : function, string, dictionary, or list of string/functions
4548+
func : function, string, list of string/functions or dictionary
45494549
Function to use for aggregating the data. If a function, must either
4550-
work when passed a %(klass)s or when passed to %(klass)s.apply. For
4551-
a DataFrame, can pass a dict, if the keys are DataFrame column names.
4550+
work when passed a %(klass)s or when passed to %(klass)s.apply.
45524551
45534552
Accepted combinations are:
45544553
4555-
- string function name.
4556-
- function.
4557-
- list of functions.
4558-
- dict of column names -> functions (or list of functions).
4554+
- string function name
4555+
- function
4556+
- list of functions and/or function names
4557+
- dict of axis labels -> functions, function names and/or list of such
45594558
%(axis)s
45604559
*args
45614560
Positional arguments to pass to `func`.
@@ -4581,15 +4580,24 @@ def pipe(self, func, *args, **kwargs):
45814580
45824581
Parameters
45834582
----------
4584-
func : callable, string, dictionary, or list of string/callables
4585-
To apply to column
4583+
func : function, string, list of string/functions or dictionary
4584+
Function to use for transforming the data. If a function, must either
4585+
work when passed a %(klass)s or when passed to %(klass)s.apply.
4586+
The function (or each function in a list/dict) must return an
4587+
object with the same length for the provided axis as the
4588+
calling %(klass)s.
45864589
4587-
Accepted Combinations are:
4590+
Accepted combinations are:
45884591
45894592
- string function name
45904593
- function
4591-
- list of functions
4592-
- dict of column names -> functions (or list of functions)
4594+
- list of functions and/or function names
4595+
- dict of axis labels -> functions, function names and/or list of such
4596+
%(axis)s
4597+
*args
4598+
Positional arguments to pass to `func`.
4599+
**kwargs
4600+
Keyword arguments to pass to `func`.
45934601
45944602
Returns
45954603
-------

0 commit comments

Comments
 (0)