maxframe.liteframe.LiteFrame.rolling#
- LiteFrame.rolling(window, min_periods=None, center=False, columns=None, order_by=None, order_by_ascending=True, window_shift=0)#
Provide rolling-window calculations.
Returns a
LiteFrameRollingobject whose aggregation methods (.sum(),.mean(), …) compute a fixed-size moving window aggregation. Only integer window sizes are supported.- Parameters:
window (int) – Size of the moving window (number of rows). Must be positive.
min_periods (int or None, default None) – Minimum number of observations in a window required to produce a value (otherwise null). Defaults to
window(matching pandas). Forcountthe value is the number of non-null observations, butmin_periodsstill gates on the number of window rows (observations), not the non-null count — consistent with pandas.center (bool, default False) – Center the window on the current row.
columns (str, list of str, or None, default None) – Column(s) to aggregate. If None, all columns are aggregated. Non-selected columns are passed through unchanged.
order_by (str, list of str, or None, default None) – Column(s) that define the order in which the window expands (equivalent to
ORDER BYinside a MaxComputeOVER()clause). The output row order is unchanged; each row receives the aggregation computed over the rows that precede it in order_by order.order_by_ascending (bool or list of bool, default True) – Sort direction for each order_by column. A single bool is broadcast to all columns.
window_shift (int, default 0) – Offset the window frame by N rows. A positive value shifts the window forward (toward later rows), a negative value backward. Matches the MaxCompute
shiftMF-specific window parameter.
- Returns:
Intermediate object; call an aggregation method to produce a LiteFrame.
- Return type:
- Raises:
NotImplementedError – If
windowis not an integer (offset/time windows unsupported), or if MF-specific fields (order_by/window_shift) are used with grouped or multi-chunk inputs.ValueError – If
windowis not positive ormin_periodsis invalid.