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))Referenced By
Section titled “Referenced By”RelationalAI Documentation
└── Build With RelationalAI
└── Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
└── Aggregate and group data
└── Average values with .avg()