pyspark.pandas.DataFrame.resampleΒΆ
-
DataFrame.
resample
(rule: str, closed: Optional[str] = None, label: Optional[str] = None, on: Optional[Series] = None) β DataFrameResampler[source]ΒΆ Resample time-series data.
Convenience method for frequency conversion and resampling of time series. The object must have a datetime-like index (only support DatetimeIndex for now), or the caller must pass the label of a datetime-like series/index to the
on
keyword parameter.New in version 3.4.0.
- Parameters
- rulestr
The offset string or object representing target conversion. Currently, supported units are {βYβ, βAβ, βMβ, βDβ, βHβ, βTβ, βMINβ, βSβ}.
- closed{{βrightβ, βleftβ}}, default None
Which side of bin interval is closed. The default is βleftβ for all frequency offsets except for βAβ, βYβ and βMβ which all have a default of βrightβ.
- label{{βrightβ, βleftβ}}, default None
Which bin edge label to label bucket with. The default is βleftβ for all frequency offsets except for βAβ, βYβ and βMβ which all have a default of βrightβ.
- onSeries, optional
For a DataFrame, column to use instead of index for resampling. Column must be datetime-like.
- Returns
- DataFrameResampler
See also
Series.resample
Resample a Series.
groupby
Group by mapping, function, label, or list of labels.