Skip to content

variance

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

Compute the population variance of values.

Parameters

  • *args

    (AggValue, default: ()) - Values to compute population variance over. Can include Distinct wrapper for distinct aggregation.

Returns

  • Aggregate - An Aggregate representing the computation of the population variance. Always returns Float.

Examples

Compute population variance of salaries:

select(aggregates.variance(Employee.salary))

Compute population variance of salaries per department:

select(Department, aggregates.variance(Employee.salary).per(Department))