postgres.aggregates.RegrAvgY

class RegrAvgY(y, x) [source] Returns the average of the dependent variable (sum(y)/N) as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrAvgX

class RegrAvgX(y, x) [source] Returns the average of the independent variable (sum(x)/N) as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrCount

class RegrCount(y, x) [source] Returns an int of the number of input rows in which both expressions are not null.

postgres.aggregates.RegrSXX

class RegrSXX(y, x) [source] Returns sum(x^2) - sum(x)^2/N (“sum of squares” of the independent variable) as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrSlope

class RegrSlope(y, x) [source] Returns the slope of the least-squares-fit linear equation determined by the (x, y) pairs as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrIntercept

class RegrIntercept(y, x) [source] Returns the y-intercept of the least-squares-fit linear equation determined by the (x, y) pairs as a float, or None if there aren’t any matching rows.

postgres.aggregates.RegrR2

class RegrR2(y, x) [source] Returns the square of the correlation coefficient as a float, or None if there aren’t any matching rows.

postgres.aggregates.CovarPop.sample

sample By default CovarPop returns the general population covariance. However, if sample=True, the return value will be the sample population covariance.

postgres.aggregates.BoolOr

class BoolOr(expression, **extra) [source] Returns True if at least one input value is true, None if all values are null or if there are no values, otherwise False.

postgres.aggregates.BoolAnd

class BoolAnd(expression, **extra) [source] Returns True, if all input values are true, None if all values are null or if there are no values, otherwise False .