Skip to content

Commit 9209528

Browse files
committed
DOC: Fix doc/source/groupby.rst:1306:42: F821 undefined name 'report_func' (pandas-dev#24178)
1 parent 51c129a commit 9209528

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

doc/source/groupby.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,11 +1301,15 @@ Piping can also be expressive when you want to deliver a grouped object to some
13011301
arbitrary function, for example:
13021302

13031303
.. code-block:: python
1304+
def mean(groupby):
1305+
return(groupby.mean())
13041306
1305-
df.groupby(['Store', 'Product']).pipe(report_func)
1307+
df.groupby(['Store', 'Product']).pipe(mean)
13061308
1307-
where ``report_func`` takes a GroupBy object and creates a report
1308-
from that.
1309+
where ``mean`` takes a GroupBy object and finds the mean of the Revenue and Quantity
1310+
columns repectively for each Store-Product combination. The ``mean`` function can
1311+
be any function that takes in a GroupBy object; the ``.pipe`` will pass the GroupBy
1312+
object as a parameter into the function you specify.
13091313

13101314
Examples
13111315
--------

0 commit comments

Comments
 (0)