Skip to content

Aggregation #1005

@lars-reimann

Description

@lars-reimann

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions