pandas.api.typing.SeriesGroupBy.resample
pandas 3.1.1 · GroupBy · method
Create time bins from a datetime-like axis, then reduce, fill or upsample within those bins.
Call syntax
pd.api.typing.SeriesGroupBy.resample(…) Full signature
pd.api.typing.SeriesGroupBy.resample(
rule,
closed=None,
label=None,
convention=None,
on=None,
origin='start_day',
offset=None,
group_keys=False,
*,
include_groups=False,
**kwargs,
)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
rule |
Required Positional or keyword |
str or DateOffset Specify the target frequency or rule used to construct time bins. |
closed |
Optional Positional or keyword Default None |
{'right', 'left'} Choose which interval boundaries are included. |
label |
Optional Positional or keyword Default None |
{'right', 'left'} Provide the label used to identify an entry or mark a result. |
convention |
Optional Positional or keyword Default None |
{'start', 'end', 's', 'e'} |
on |
Optional Positional or keyword Default None |
str Choose the shared key columns or name the axis column used by the operation. |
origin |
Optional Positional or keyword Default 'start_day' |
Timestamp or str Choose the reference timestamp or origin from which a numeric time or bin is measured. |
offset |
Optional Positional or keyword Default None |
Timedelta or str Shift the origin or boundary used to align time bins or labels. |
group_keys |
Optional Positional or keyword Default False |
bool Choose whether the grouping keys become index levels in the result. |
include_groups |
Optional Keyword only Default False |
bool Choose whether the grouping columns are included in inputs passed to the callback. |
**kwargs |
Optional Additional keyword arguments |
Returns
DatetimeIndexResampler, PeriodIndexResampler or TimedeltaResampler