avg
relationalai.semantics.std.aggregates
avg(*args: AggValue) -> AggregateCompute the average of values.
Parameters
Section titled “Parameters”
(*argsAggValue, default:()) - Values to average.
Returns
Section titled “Returns”Aggregate- AnAggregaterepresenting the computation of the average. ReturnsScaledNumberif the input isNumber, orFloatif the input isFloat.
Examples
Section titled “Examples”Compute average salary:
>>> select(aggregates.avg(Employee.salary))Compute average order amount per customer:
>>> select(Customer, aggregates.avg(Order.amount).per(Customer).where(Order.customer == Customer))