Skip to content

min

relationalai.semantics.std.aggregates
min(*args: AggValue) -> Aggregate

Find the minimum value.

  • *args

    (AggValue, default: ()) - Values to find minimum from.
  • Aggregate - An Aggregate representing the computation of the minimum value. Returns the same type as the input.

Find minimum salary:

>>> select(aggregates.min(Employee.salary))

Find minimum price per category:

>>> select(Category, aggregates.min(Product.price).per(Category).where(Product.category == Category))
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
        └──  Aggregate and group data
            └──  Find minimum values with .min()