indexed_rolling_window_operation#

indexed_rolling_window_operation(*, key_column: DataColumn, value_column: DataColumn, operation_function: Callable, window_length: int) DataColumn[source]

Apply a rolling window operation on data corresponding to the unique keys, repeating the values on duplicates.

Useful for rolling windows on period data across periods, with each period having the same key and thus the same data.

Parameters:
  • key_column – Keys on which we base the rolling window.

  • value_column – Values to be used for the rolling window.

  • operation_function – Function to apply on each rolling window.

  • window_length – Length of each rolling window.

Return type:

Column with the resulting values for each key in the same order as key_column.