maxframe.liteframe.LiteFrame.expanding#
- LiteFrame.expanding(min_periods=1, columns=None, order_by=None, order_by_ascending=True, window_shift=0, reverse=False)#
Provide expanding window calculations.
Returns a
LiteFrameExpandingobject whose aggregation methods (.sum(),.mean(), …) compute a growing cumulative window from the start to the current row. Unlikecum*, expanding fills NaN positions with the accumulated value.- Parameters:
min_periods (int, default 1) – Minimum number of observations in the window required to produce a value (otherwise null).
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 leading edge of the growing window by N rows. A positive value extends the window forward (the window becomes
[0, i+shift]), a negative value shrinks it. Matches the MaxComputeshiftMF-specific window parameter.reverse (bool, default False) – Flip the expanding window so it grows from the last row backward (a “narrowing” window covering
[i, n-1]). Matches the MaxComputereverse_rangeMF-specific window parameter. May be combined withwindow_shift: the window then covers[i+window_shift, n-1].
- Returns:
Intermediate object; call an aggregation method to produce a LiteFrame.
- Return type: