innovate.aggregate_weekly
All current Python definitions
View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4
Signature
Section titled “Signature”def aggregate_weekly( data: pl.DataFrame | pl.LazyFrame, value_columns: list[str], *, time_column: str = 'time',) -> pl.DataFrame: ...Sum observations into 168-hour windows anchored at the earliest timestamp.
Parameters
Section titled “Parameters”data: Polars frame with non-null Date or Datetime timestamps; lazy input is collected and observations are sorted before grouping.value_columns: Nonempty list of distinct numeric columns to sum.time_column: Timestamp column name; defaults to"time".
Returns
Section titled “Returns”Table of left-labelled weekly windows and value sums. Empty weekly windows are not inserted; the anchor is a data timestamp, not a calendar weekday.
Raises
Section titled “Raises”ValueError: If timestamps or value-column selections violate theaggregate_time_seriesvalidation rules.polars.exceptions.PolarsError: If columns are missing or grouping fails.