Is your feature request related to a problem?
Besides the explicit methods of Column, we do not support aggregation yet.
Desired solution
- New subclass of
Cell: AggregatedCell or AggregationCell.
- Think of it as a
Cell with memory.
- New
Table method aggregate
- Callback
(Row) -> AggregatedCell
- Returns a new
Table with a single row
- For symmetry, also add an
aggregate method to Column
- Other mapping
Table methods (e.g. transform_column) should also be able to handle AggregatedCell, but produce the same row count as a normal Cell, e.g. by filling the entire column with the same computed value.
- Operations that mix
AggregateCell and Cell should produce a Cell, so they cannot be used with Table.aggregate. This would otherwise be ambiguous, as we want a table with a single row.
- Namespace
Cell.agg that wraps polars's aggregation expressions.
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response
Is your feature request related to a problem?
Besides the explicit methods of
Column, we do not support aggregation yet.Desired solution
Cell:AggregatedCellorAggregationCell.Cellwith memory.Tablemethodaggregate(Row) -> AggregatedCellTablewith a single rowaggregatemethod toColumnTablemethods (e.g.transform_column) should also be able to handleAggregatedCell, but produce the same row count as a normalCell, e.g. by filling the entire column with the same computed value.AggregateCellandCellshould produce aCell, so they cannot be used withTable.aggregate. This would otherwise be ambiguous, as we want a table with a single row.Cell.aggthat wrapspolars's aggregation expressions.Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response