diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 48c00140461b5..b30e5e3569c03 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -190,14 +190,14 @@ 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 +Instead of writing: Use `.pipe` when you want to improve readability by chaining together functions that expect Series, DataFrames, GroupBy or Resampler objects. -Instead of writing + >>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c) @@ -212,19 +212,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 --------