.groupby.SeriesGroupBy.rolling ](pandas.core.groupby.SeriesGroupBy.rolling.html)
    * [ pandas.core.groupby.SeriesGroupBy.sample ](pandas.core.groupby.SeriesGroupBy.sample.html)
    * [ pandas.core.groupby.SeriesGroupBy.sem ](pandas.core.groupby.SeriesGroupBy.sem.html)
    * [ pandas.core.groupby.SeriesGroupBy.shift ](pandas.core.groupby.SeriesGroupBy.shift.html)
    * [ pandas.core.groupby.SeriesGroupBy.size ](pandas.core.groupby.SeriesGroupBy.size.html)
    * [ pandas.core.groupby.SeriesGroupBy.skew ](pandas.core.groupby.SeriesGroupBy.skew.html)
    * [ pandas.core.groupby.SeriesGroupBy.std ](pandas.core.groupby.SeriesGroupBy.std.html)
    * [ pandas.core.groupby.SeriesGroupBy.sum ](pandas.core.groupby.SeriesGroupBy.sum.html)
    * [ pandas.core.groupby.SeriesGroupBy.var ](pandas.core.groupby.SeriesGroupBy.var.html)
    * [ pandas.core.groupby.SeriesGroupBy.tail ](pandas.core.groupby.SeriesGroupBy.tail.html)
    * [ pandas.core.groupby.SeriesGroupBy.take ](pandas.core.groupby.SeriesGroupBy.take.html)
    * [ pandas.core.groupby.SeriesGroupBy.value_counts ](pandas.core.groupby.SeriesGroupBy.value_counts.html)
    * [ pandas.core.groupby.DataFrameGroupBy.boxplot ](pandas.core.groupby.DataFrameGroupBy.boxplot.html)
    * [ pandas.core.groupby.DataFrameGroupBy.hist ](pandas.core.groupby.DataFrameGroupBy.hist.html)
    * [ pandas.core.groupby.SeriesGroupBy.hist ](pandas.core.groupby.SeriesGroupBy.hist.html)
    * [ pandas.core.groupby.DataFrameGroupBy.plot ](pandas.core.groupby.DataFrameGroupBy.plot.html)
    * [ pandas.core.groupby.SeriesGroupBy.plot ](pandas.core.groupby.SeriesGroupBy.plot.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ GroupBy ](../groupby.html)
  * pandas.core.... 

#  pandas.core.groupby.SeriesGroupBy.pipe  #

SeriesGroupBy.  pipe  (  _ func  _ , _ *  args  _ , _ **  kwargs  _ )  [
[source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/groupby/groupby.py#L991-L1020) #

    

Apply a ` func  ` with arguments to this GroupBy object and return its result.

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

    
    
    >>> h = lambda x, arg2, arg3: x + 1 - arg2 * arg3
    >>> g = lambda x, arg1: x * 5 / arg1
    >>> f = lambda x: x ** 4
    >>> df = pd.DataFrame([["a", 4], ["b", 5]], columns=["group", "value"])
    >>> h(g(f(df.groupby('group')), arg1=1), arg2=2, arg3=3)  
    

You can write

    
    
    >>> (df.groupby('group')
    ...    .pipe(f)
    ...    .pipe(g, arg1=1)
    ...    .pipe(h, arg2=2, arg3=3))  
    

which is much more readable.

Parameters  :

    

**func** callable or tuple of (callable, str)

    

Function to apply to this GroupBy object or, alternatively, a  (callable,
data_keyword)  tuple where  data_keyword  is a string indicating the keyword
of  callable  that expects the GroupBy object.

**args** iterable, optional

    

Positional arguments passed into  func  .

**kwargs** dict, optional

    

A dictionary of keyword arguments passed into  func  .

Returns  :

    

the return type of  func  .

    

See also

` Series.pipe  `

    

Apply a function with arguments to a series.

` DataFrame.pipe  `

    

Apply a function with arguments to a dataframe.

[ ` apply  `
](pandas.core.groupby.SeriesGroupBy.apply.html#pandas.core.groupby.SeriesGroupBy.apply
"pandas.core.groupby.SeriesGroupBy.apply")

    

Apply function to each group instead of to the full GroupBy object.

Notes

See more [ here ](https://pandas.pydata.org/pandas-
docs/stable/user_guide/groupby.html#piping-function-calls)

Examples

    
    
    >>> df = pd.DataFrame({'A': 'a b a b'.split(),