Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Update pandas.core.groupby.GroupBy.pipe docstring #32531

Closed
wants to merge 10 commits into from
20 changes: 10 additions & 10 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,13 @@ class providing the base-class of operations.
)

_pipe_template = """
Apply a function `func` with arguments to this %(klass)s object and return
the function's result.
Apply a function `func` with arguments to this %(klass)s object and return the result.

%(versionadded)s

Use `.pipe` when you want to improve readability by chaining together
functions that expect Series, DataFrames, GroupBy or Resampler objects.
Instead of writing
Instead of writing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this full stop necessary here? It doesn't feel like it's the end of the sentence, could it be changed to "Instead of writing:"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay


>>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c)

Expand All @@ -212,19 +211,20 @@ class providing the base-class of operations.

Parameters
----------
func : callable or tuple of (callable, string)
Function to apply to this %(klass)s object or, alternatively,
func : callable or tuple of (callable, str)
Function to apply to this %(klass)s object or
a `(callable, data_keyword)` tuple where `data_keyword` is a
string indicating the keyword of `callable` that expects the
%(klass)s object.
args : iterable, optional
Positional arguments passed into `func`.
kwargs : dict, optional
A dictionary of keyword arguments passed into `func`.
*args : iterable, optional
Positional arguments passed into `func`.
**kwargs : dict, optional
A dictionary of keyword arguments passed into `func`.

Returns
-------
object : the return type of `func`.
object
The return type of `func`.

See Also
--------
Expand Down