Skip to main content
`Ctrl`+`K`

# Resampling

Note

For an overview, see Time series / date functionality.

`pandas.api.typing.Resampler` instances are returned by resample calls: `pandas.DataFrame.resample()`, `pandas.Series.resample()`.

## Indexing, iteration

`Resampler.__iter__`() | Groupby iterator.
`Resampler.groups` | Dict {group name -> group labels}.
`Resampler.indices` | Dict {group name -> group indices}.
`Resampler.get_group`(name) | Construct DataFrame from group with provided name.

## Function application

`Resampler.apply`([func]) | Aggregate using one or more operations over the specified axis.
`Resampler.aggregate`([func]) | Aggregate using one or more operations over the specified axis.
`Resampler.transform`(arg, *args, **kwargs) | Call function producing a like-indexed Series on each group.
`Resampler.pipe`(func, *args, **kwargs) | Apply a `func` with arguments to this Resampler object and return its result.

## Upsampling

`Resampler.ffill`([limit]) | Forward fill the values.
`Resampler.bfill`([limit]) | Backward fill the new missing values in the resampled data.
`Resampler.nearest`([limit]) | Resample by using the nearest value.
`Resampler.asfreq`([fill_value]) | Return the values at the new freq, essentially a reindex.
`Resampler.interpolate`([method, axis, limit, ...]) | Interpolate values between target timestamps according to different methods.

## Computations / descriptive stats

`Resampler.count`() | Compute count of group, excluding missing values.
`Resampler.nunique`() | Return number of unique elements in the group.
`Resampler.first`([numeric_only, min_count, ...]) | Compute the first non-null entry of each column.
`Resampler.last`([numeric_only, min_count, skipna]) | Compute the last non-null entry of each column.
`Resampler.max`([numeric_only, min_count]) | Compute max value of group.
`Resampler.mean`([numeric_only]) | Compute mean of groups, excluding missing values.
`Resampler.median`([numeric_only]) | Compute median of groups, excluding missing values.
`Resampler.min`([numeric_only, min_count]) | Compute min value of group.
`Resampler.ohlc`() | Compute open, high, low and close values of a group, excluding missing values.
`Resampler.prod`([numeric_only, min_count]) | Compute prod of group values.
`Resampler.size`() | Compute group sizes.
`Resampler.sem`([ddof, numeric_only]) | Compute standard error of the mean of groups, excluding missing values.
`Resampler.std`([ddof, numeric_only]) | Compute standard deviation of groups, excluding missing values.
`Resampler.sum`([numeric_only, min_count]) | Compute sum of group values.
`Resampler.var`([ddof, numeric_only]) | Compute variance of groups, excluding missing values.
`Resampler.quantile`([q]) | Return value at the given quantile.