bigframes.pandas.Series.resample#

Series.resample(rule:str,*,closed:Literal['right','left']|None=None,label:Literal['right','left']|None=None,level:str|int|Sequence[str|int]|None=None,origin:Timestamp|datetime|datetime64|int|float|str|Literal['epoch','start','start_day','end','end_day']='start_day')SeriesGroupBy[source]#

Resample time-series data.

Examples:

>>>importbigframes.pandasasbpd>>>data={..."timestamp_col":pd.date_range(...start="2021-01-01 13:00:00",periods=30,freq="1s"...),..."int64_col":range(30),...}>>>s=bpd.DataFrame(data).set_index("timestamp_col")>>>s.resample(rule="7s",origin="epoch").min()                    int64_col2021-01-01 12:59:56          02021-01-01 13:00:03          32021-01-01 13:00:10         102021-01-01 13:00:17         172021-01-01 13:00:24         24[5 rows x 1 columns]
Parameters:
  • rule (str) – The offset string representing target conversion.Offsets ‘ME’, ‘YE’, ‘QE’, ‘BME’, ‘BA’, ‘BQE’, and ‘W’ arenotsupported.

  • closed (Literal['left']|None) – Which side of bin interval is closed. The default is ‘left’ forall supported frequency offsets.

  • label (Literal['right']|Literal['left']|None) – Which bin edge label to label bucket with. The default is ‘left’for all supported frequency offsets.

  • on (str,default None) – For a DataFrame, column to use instead of index for resampling. Columnmust be datetime-like.

  • level (str orint,default None) – For a MultiIndex, level (name or number) to use for resampling.level must be datetime-like.

  • origin (str,default 'start_day') – The timestamp on which to adjust the grouping. Must be one of the following:‘epoch’: origin is 1970-01-01‘start’: origin is the first value of the timeseries‘start_day’: origin is the first day at midnight of the timeseriesOrigin values ‘end’ and ‘end_day’ arenot supported.

Returns:

SeriesGroupBy object.

Return type:

SeriesGroupBy

On this page

This Page