bigframes.geopandas.GeoSeries.rolling#
- GeoSeries.rolling(window:int|Timedelta|timedelta64|timedelta|str,min_periods:int|None=None,closed:Literal['right','left','both','neither']='right')→Window#
Provide rolling window calculations.
Examples:
>>>importbigframes.pandasasbpd>>>s=bpd.Series([0,1,2,3,4])>>>s.rolling(window=3).min()0 <NA>1 <NA>2 03 14 2dtype: Int64
>>>df=bpd.DataFrame({'A':[0,1,2,3],'B':[0,2,4,6]})>>>df.rolling(window=2,on='A',closed='both').sum()A B0 0 <NA>1 1 22 2 63 3 12[4 rows x 2 columns]
- Parameters:
window (int,pandas.Timedelta,numpy.timedelta64,datetime.timedelta,str) –
Size of the moving window.
If an integer, the fixed number of observations used foreach window.
If a string, the timedelta representation in string. This stringmust be parsable by pandas.Timedelta().
Otherwise, the time range for each window.
min_periods (int,default None) –
Minimum number of observations in window required to have a value;otherwise, result is
np.nan.For a window that is specified by an integer,
min_periodswill defaultto the size of the window.For a window that is not spicified by an interger,
min_periodswill defaultto 1.on (str,optional) – For a DataFrame, a column label on which to calculate the rolling window,rather than the DataFrame’s index.
closed (str,default 'right') – If ‘right’, the first point in the window is excluded from calculations.If ‘left’, the last point in the window is excluded from calculations.If ‘both’, the no points in the window are excluded from calculations.If ‘neither’, the first and last points in the window are excluded from calculations.
- Returns:
Windowsubclass if awin_typeis passed.Rollingsubclass ifwin_typeis not passed.
- Return type:
bigframes.core.window.Window