Skip to content

per

relationalai.semantics.std.aggregates
per(*args: Value) -> Per

Create a grouped aggregation context.

  • *args

    (Value, default: ()) - Values defining the grouping.
  • Per - A Per object for performing grouped aggregations.

Compute sum per category:

aggregates.per(Category).sum(amount)

Count items per department:

aggregates.per(Department).count()
RelationalAI Documentation
├──  Build With RelationalAI
│   └──  Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
│       └──  Aggregate and group data
│           └──  Group results with per()
└──  Release Notes
    └──  Python API Release Notes
        ├──  What’s New in Version 1.22.0
        │   └──  Bug Fixes
        ├──  What’s New in Version 1.26.0
        │   └──  Bug Fixes
        └──  What’s New in Version 1.26.1
            └──  Bug Fixes