time_stream.aggregation.Nth#
- class time_stream.aggregation.Nth(n)[source]#
An aggregation class to select the nth value within each aggregation period.
- Parameters:
n (int)
- __init__(n)[source]#
Initialise Nth aggregation.
- Parameters:
n (
int) – The index position (starting at 1) of the value to select within each aggregation period (e.g. n=12 selects the 12th hour of each day when aggregating hourly data to daily).
Methods
__init__(n)Initialise Nth aggregation.
available()Return a sorted list of available registered keys.
expr(ctx, columns)Return the Polars expression for selecting the nth value in an aggregation period.
get(spec, **kwargs)Resolve spec to an instance of Self:
post_expr(_ctx, _columns)Return additional Polars expressions to be applied after the aggregation.
register(register_cls)A method used as a decorator for subclasses to add to the register by its name attribute.
Attributes
name