Skip to content

Commit 8f73bed

Browse files
vladuJulianWgs
authored andcommitted
DOC: Fix documentation for DataFrame.groupby.transform (pandas-dev#40506)
1 parent d4d6921 commit 8f73bed

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pandas/core/groupby/groupby.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ class providing the base-class of operations.
121121

122122
_apply_docs = {
123123
"template": """
124-
Apply function `func` group-wise and combine the results together.
124+
Apply function ``func`` group-wise and combine the results together.
125125
126-
The function passed to `apply` must take a {input} as its first
127-
argument and return a DataFrame, Series or scalar. `apply` will
126+
The function passed to ``apply`` must take a {input} as its first
127+
argument and return a DataFrame, Series or scalar. ``apply`` will
128128
then take care of combining the results back together into a single
129-
dataframe or series. `apply` is therefore a highly flexible
129+
dataframe or series. ``apply`` is therefore a highly flexible
130130
grouping method.
131131
132-
While `apply` is a very flexible method, its downside is that
132+
While ``apply`` is a very flexible method, its downside is that
133133
using it can be quite a bit slower than using more specific methods
134-
like `agg` or `transform`. Pandas offers a wide range of method that will
135-
be much faster than using `apply` for their specific purposes, so try to
136-
use them before reaching for `apply`.
134+
like ``agg`` or ``transform``. Pandas offers a wide range of method that will
135+
be much faster than using ``apply`` for their specific purposes, so try to
136+
use them before reaching for ``apply``.
137137
138138
Parameters
139139
----------
@@ -142,7 +142,7 @@ class providing the base-class of operations.
142142
returns a dataframe, a series or a scalar. In addition the
143143
callable may take positional and keyword arguments.
144144
args, kwargs : tuple and dict
145-
Optional positional and keyword arguments to pass to `func`.
145+
Optional positional and keyword arguments to pass to ``func``.
146146
147147
Returns
148148
-------
@@ -159,9 +159,9 @@ class providing the base-class of operations.
159159
160160
Notes
161161
-----
162-
In the current implementation `apply` calls `func` twice on the
162+
In the current implementation ``apply`` calls ``func`` twice on the
163163
first group to decide whether it can take a fast or slow code
164-
path. This can lead to unexpected behavior if `func` has
164+
path. This can lead to unexpected behavior if ``func`` has
165165
side-effects, as they will take effect twice for the first
166166
group.
167167
@@ -352,12 +352,12 @@ class providing the base-class of operations.
352352
353353
See Also
354354
--------
355-
%(klass)s.groupby.apply : Apply function func group-wise
356-
and combine the results together.
355+
%(klass)s.groupby.apply : Apply function ``func`` group-wise and combine
356+
the results together.
357357
%(klass)s.groupby.aggregate : Aggregate using one or more
358358
operations over the specified axis.
359-
%(klass)s.transform : Transforms the Series on each group
360-
based on the given function.
359+
%(klass)s.transform : Call ``func`` on self producing a %(klass)s with
360+
transformed values.
361361
362362
Notes
363363
-----

0 commit comments

Comments
 (0)