Skip to content

daft.functions.percentile#

percentile #

percentile(expr: Expression, percentage: float) -> Expression

Calculates the exact percentile for a column of numeric values.

Parameters:

Name Type Description Default
percentage float

Percentage at which to compute the exact value. Must be between 0 and 1.

required
Source code in daft/functions/agg.py
144
145
146
147
148
149
150
def percentile(expr: Expression, percentage: float) -> Expression:
    """Calculates the exact percentile for a column of numeric values.

    Args:
        percentage: Percentage at which to compute the exact value. Must be between 0 and 1.
    """
    return Expression._from_pyexpr(expr._expr.percentile(percentage))