# pandas 3.1.0 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

        Provide resampling within each group of a groupby.

        Given a grouper, the function resamples it according to a string
        "string" -> "frequency".

        See the :ref:`frequency aliases <timeseries.offset_aliases>`
        documentation for more details.

        Parameters
        ----------
        rule : str or DateOffset
            The offset string or object representing target grouper conversion.
        closed : {'right', 'left'}, optional
            Which side of bin interval is closed. See :meth:`Series.resample`.
        label : {'right', 'left'}, optional
            Which bin edge label to label bucket with. See :meth:`Series.resample`.
        convention : {'start', 'end', 's', 'e'}, optional
            For ``PeriodIndex`` only. See :meth:`Series.resample`.
        on : str, optional
            For a DataFrame, column to use instead of index for resampling.
            Column must be datetime-like.
        origin : Timestamp or str, default 'start_day'
            The timestamp on which to adjust the grouping. See
            :meth:`Series.resample` for accepted string values.
        offset : Timedelta or str, optional
            An offset timedelta added to the origin.
        group_keys : bool, default False
            Whether to include the group keys in the result index when using
            ``.apply()`` on the resampled object.
        include_groups : bool, default False
            When True, will attempt to include the groupings in the operation in
            the case that they are columns of the DataFrame. If this raises a
            TypeError, the result will be computed with the groupings excluded.
            When False, the groupings will be excluded when applying ``func``.

            .. versionadded:: 2.2.0

            .. versionchanged:: 3.0

               The default was changed to False, and True is no longer allowed.

        **kwargs
            Additional keyword arguments forwarded to the underlying
            :class:`Grouper`.

        Returns
        -------
        DatetimeIndexResampler, PeriodIndexResampler or TimedeltaResampler
            Resampler object for the type of the index.

        See Also
        --------
        Series.resample : Resample a Series.
        DataFrame.resample : Resample a DataFrame.
        Grouper : Specify a frequency to resample with when
            grouping by a key.
        DatetimeIndex.resample : Frequency conversion and resampling of
            time series.

        Examples
        --------
        >>> idx = pd.date_range("1/1/2000", periods=4, freq="min")
        >>> df = pd.DataFrame(data=4 * [range(2)], index=idx, columns=["a", "b"])
        >>> df.iloc[2, 0] = 5
        >>> df
                            a  b
        2000-01-01 00:00:00  0  1
        2000-01-01 00:01:00  0  1
        2000-01-01 00:02:00  5  1
        2000-01-01 00:03:00  0  1

        Downsample the DataFrame into 3 minute bins and sum the values of
        the timestamps falling into a bin.

        >>> df.groupby("a").resample("3min").sum()
                                 b
        a
        0   2000-01-01 00:00:00  2
            2000-01-01 00:03:00  1
        5   2000-01-01 00:00:00  1

        Upsample the series into 30 second bins.

        >>> df.groupby("a").resample("30s").sum()
                            b
        a
        0   2000-01-01 00:00:00  1
            2000-01-01 00:00:30  0
            2000-01-01 00:01:00  1
            2000-01-01 00:01:30  0
            2000-01-01 00:02:00  0
            2000-01-01 00:02:30  0
            2000-01-01 00:03:00  1
        5   2000-01-01 00:02:00  1

        Resample by month. Values are assigned to the month of the period.

        >>> df.groupby("a").resample("ME").sum()
                    b
        a
        0   2000-01-31  3
        5   2000-01-31  1

        Downsample the series into 3 minute bins as above, but close the right
        side of the bin interval.

        >>> (df.groupby("a").resample("3min", closed="right").sum())
                                 b
        a
        0   1999-12-31 23:57:00  1
            2000-01-01 00:00:00  2
        5   2000-01-01 00:00:00  1

        Downsample the series into 3 minute bins and close the right side of
        the bin interval, but label each bin using the right edge instead of
        the left.

        >>> (df.groupby("a").resample("3min", closed="right", label="right").sum())
                                 b
        a
        0   2000-01-01 00:00:00  1
            2000-01-01 00:03:00  2
        5   2000-01-01 00:03:00  1
        
=== parse numpydoc
short_description: 'Provide resampling within each group of a groupby.'
long_description: |
  Given a grouper, the function resamples it according to a string
  "string" -> "frequency".
  
  See the :ref:`frequency aliases <timeseries.offset_aliases>`
  documentation for more details.
blank_after_short_description: True
blank_after_long_description: True
style: numpydoc
- DocstringParam
  description: 'The offset string or object representing target grouper conversion.'
  kind: param
  key: 'param'
  arg_name: 'rule'
  type_name: 'str or DateOffset'
  is_optional: False
- DocstringParam
  description: 'Which side of bin interval is closed. See :meth:`Series.resample`.'
  kind: param
  key: 'param'
  arg_name: 'closed'
  type_name: "{'right', 'left'}"
  is_optional: True
  raw_type_name: "{'right', 'left'}, optional"
- DocstringParam
  description: 'Which bin edge label to label bucket with. See :meth:`Series.resample`.'
  kind: param
  key: 'param'
  arg_name: 'label'
  type_name: "{'right', 'left'}"
  is_optional: True
  raw_type_name: "{'right', 'left'}, optional"
- DocstringParam
  description: 'For ``PeriodIndex`` only. See :meth:`Series.resample`.'
  kind: param
  key: 'param'
  arg_name: 'convention'
  type_name: "{'start', 'end', 's', 'e'}"
  is_optional: True
  raw_type_name: "{'start', 'end', 's', 'e'}, optional"
- DocstringParam
  description: |
    For a DataFrame, column to use instead of index for resampling.
    Column must be datetime-like.
  kind: param
  key: 'param'
  arg_name: 'on'
  type_name: 'str'
  is_optional: True
  raw_type_name: 'str, optional'
- DocstringParam
  description: |
    The timestamp on which to adjust the grouping. See
    :meth:`Series.resample` for accepted string values.
  kind: param
  key: 'param'
  arg_name: 'origin'
  type_name: 'Timestamp or str'
  is_optional: True
  default: "'start_day'"
  raw_type_name: "Timestamp or str, default 'start_day'"
- DocstringParam
  description: 'An offset timedelta added to the origin.'
  kind: param
  key: 'param'
  arg_name: 'offset'
  type_name: 'Timedelta or str'
  is_optional: True
  raw_type_name: 'Timedelta or str, optional'
- DocstringParam
  description: |
    Whether to include the group keys in the result index when using
    ``.apply()`` on the resampled object.
  kind: param
  key: 'param'
  arg_name: 'group_keys'
  type_name: 'bool'
  is_optional: True
  default: 'False'
  raw_type_name: 'bool, default False'
- DocstringParam
  description: |
    When True, will attempt to include the groupings in the operation in
    the case that they are columns of the DataFrame. If this raises a
    TypeError, the result will be computed with the groupings excluded.
    When False, the groupings will be excluded when applying ``func``.
    
    .. versionadded:: 2.2.0
    
    .. versionchanged:: 3.0
    
       The default was changed to False, and True is no longer allowed.
  kind: param
  key: 'param'
  arg_name: 'include_groups'
  type_name: 'bool'
  is_optional: True
  default: 'False'
  raw_type_name: 'bool, default False'
- DocstringParam
  description: |
    Additional keyword arguments forwarded to the underlying
    :class:`Grouper`.
  kind: param
  key: 'param'
  arg_name: '**kwargs'
  is_optional: False
- DocstringReturns
  description: 'Resampler object for the type of the index.'
  kind: returns
  key: 'returns'
  type_name: 'DatetimeIndexResampler, PeriodIndexResampler or TimedeltaResampler'
  is_generator: False
- DocstringMeta
  description: |
    Series.resample : Resample a Series.
    DataFrame.resample : Resample a DataFrame.
    Grouper : Specify a frequency to resample with when
        grouping by a key.
    DatetimeIndex.resample : Frequency conversion and resampling of
        time series.
  kind: text
  key: 'see_also'
  title: 'See Also'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> idx = pd.date_range("1/1/2000", periods=4, freq="min")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> df = pd.DataFrame(data=4 * [range(2)], index=idx, columns=["a", "b"])'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> df.iloc[2, 0] = 5'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> df
                        a  b
    2000-01-01 00:00:00  0  1
    2000-01-01 00:01:00  0  1
    2000-01-01 00:02:00  5  1
    2000-01-01 00:03:00  0  1
- DocstringExample
  description: |
    Downsample the DataFrame into 3 minute bins and sum the values of
    the timestamps falling into a bin.
  kind: examples
  key: 'examples'
  snippet: |
    >>> df.groupby("a").resample("3min").sum()
                             b
    a
    0   2000-01-01 00:00:00  2
        2000-01-01 00:03:00  1
    5   2000-01-01 00:00:00  1
- DocstringExample
  description: 'Upsample the series into 30 second bins.'
  kind: examples
  key: 'examples'
  snippet: |
    >>> df.groupby("a").resample("30s").sum()
                        b
    a
    0   2000-01-01 00:00:00  1
        2000-01-01 00:00:30  0
        2000-01-01 00:01:00  1
        2000-01-01 00:01:30  0
        2000-01-01 00:02:00  0
        2000-01-01 00:02:30  0
        2000-01-01 00:03:00  1
    5   2000-01-01 00:02:00  1
- DocstringExample
  description: 'Resample by month. Values are assigned to the month of the period.'
  kind: examples
  key: 'examples'
  snippet: |
    >>> df.groupby("a").resample("ME").sum()
                b
    a
    0   2000-01-31  3
    5   2000-01-31  1
- DocstringExample
  description: |
    Downsample the series into 3 minute bins as above, but close the right
    side of the bin interval.
  kind: examples
  key: 'examples'
  snippet: |
    >>> (df.groupby("a").resample("3min", closed="right").sum())
                             b
    a
    0   1999-12-31 23:57:00  1
        2000-01-01 00:00:00  2
    5   2000-01-01 00:00:00  1
- DocstringExample
  description: |
    Downsample the series into 3 minute bins and close the right side of
    the bin interval, but label each bin using the right edge instead of
    the left.
  kind: examples
  key: 'examples'
  snippet: |
    >>> (df.groupby("a").resample("3min", closed="right", label="right").sum())
                             b
    a
    0   2000-01-01 00:00:00  1
        2000-01-01 00:03:00  2
    5   2000-01-01 00:03:00  1
=== detect
numpydoc
=== compose numpydoc
Provide resampling within each group of a groupby.

Given a grouper, the function resamples it according to a string
"string" -> "frequency".

See the :ref:`frequency aliases <timeseries.offset_aliases>`
documentation for more details.

Parameters
----------
rule : str or DateOffset
    The offset string or object representing target grouper conversion.
closed : {'right', 'left'}, optional
    Which side of bin interval is closed. See :meth:`Series.resample`.
label : {'right', 'left'}, optional
    Which bin edge label to label bucket with. See :meth:`Series.resample`.
convention : {'start', 'end', 's', 'e'}, optional
    For ``PeriodIndex`` only. See :meth:`Series.resample`.
on : str, optional
    For a DataFrame, column to use instead of index for resampling.
    Column must be datetime-like.
origin : Timestamp or str, default 'start_day'
    The timestamp on which to adjust the grouping. See
    :meth:`Series.resample` for accepted string values.
offset : Timedelta or str, optional
    An offset timedelta added to the origin.
group_keys : bool, default False
    Whether to include the group keys in the result index when using
    ``.apply()`` on the resampled object.
include_groups : bool, default False
    When True, will attempt to include the groupings in the operation in
    the case that they are columns of the DataFrame. If this raises a
    TypeError, the result will be computed with the groupings excluded.
    When False, the groupings will be excluded when applying ``func``.

    .. versionadded:: 2.2.0

    .. versionchanged:: 3.0

       The default was changed to False, and True is no longer allowed.
**kwargs
    Additional keyword arguments forwarded to the underlying
    :class:`Grouper`.

Returns
-------
DatetimeIndexResampler, PeriodIndexResampler or TimedeltaResampler
    Resampler object for the type of the index.

See Also
--------
Series.resample : Resample a Series.
DataFrame.resample : Resample a DataFrame.
Grouper : Specify a frequency to resample with when
    grouping by a key.
DatetimeIndex.resample : Frequency conversion and resampling of
    time series.

Examples
--------
>>> idx = pd.date_range("1/1/2000", periods=4, freq="min")
>>> df = pd.DataFrame(data=4 * [range(2)], index=idx, columns=["a", "b"])
>>> df.iloc[2, 0] = 5
>>> df
                    a  b
2000-01-01 00:00:00  0  1
2000-01-01 00:01:00  0  1
2000-01-01 00:02:00  5  1
2000-01-01 00:03:00  0  1

Downsample the DataFrame into 3 minute bins and sum the values of
the timestamps falling into a bin.

>>> df.groupby("a").resample("3min").sum()
                         b
a
0   2000-01-01 00:00:00  2
    2000-01-01 00:03:00  1
5   2000-01-01 00:00:00  1

Upsample the series into 30 second bins.

>>> df.groupby("a").resample("30s").sum()
                    b
a
0   2000-01-01 00:00:00  1
    2000-01-01 00:00:30  0
    2000-01-01 00:01:00  1
    2000-01-01 00:01:30  0
    2000-01-01 00:02:00  0
    2000-01-01 00:02:30  0
    2000-01-01 00:03:00  1
5   2000-01-01 00:02:00  1

Resample by month. Values are assigned to the month of the period.

>>> df.groupby("a").resample("ME").sum()
            b
a
0   2000-01-31  3
5   2000-01-31  1

Downsample the series into 3 minute bins as above, but close the right
side of the bin interval.

>>> (df.groupby("a").resample("3min", closed="right").sum())
                         b
a
0   1999-12-31 23:57:00  1
    2000-01-01 00:00:00  2
5   2000-01-01 00:00:00  1

Downsample the series into 3 minute bins and close the right side of
the bin interval, but label each bin using the right edge instead of
the left.

>>> (df.groupby("a").resample("3min", closed="right", label="right").sum())
                         b
a
0   2000-01-01 00:00:00  1
    2000-01-01 00:03:00  2
5   2000-01-01 00:03:00  1
