Skip to content

daft.functions.list_mean#

list_mean #

list_mean(list_expr: Expression) -> Expression

Calculates the mean of each list. If no non-null values in a list, the result is null.

Parameters:

Name Type Description Default
list_expr List Expression

expression to calculate the mean of.

required

Returns:

Name Type Description
Expression Float64 Expression

an expression with the calculated mean of the list values

Source code in daft/functions/list.py
117
118
119
120
121
122
123
124
125
126
def list_mean(list_expr: Expression) -> Expression:
    """Calculates the mean of each list. If no non-null values in a list, the result is null.

    Args:
        list_expr (List Expression): expression to calculate the mean of.

    Returns:
        Expression (Float64 Expression): an expression with the calculated mean of the list values
    """
    return Expression._call_builtin_scalar_fn("list_mean", list_expr)