Skip to content

describe_by builtin

describe_by(
    values,
    categories,
    *,
    weights=None,
    quantiles=Ellipsis,
    data=None,
)

Weighted statistics per category, as describe, then over all values.

Parameters:

Name Type Description Default
values array_like or str

Values, or their column in data; NaN is skipped.

required
categories array_like or str

Category (e.g. domain) of each value, int or str, or its column.

required
weights array_like or str

Declustering weights; default the volumes of a BlockModel data, else 1.

None
quantiles sequence of float

Probabilities of the quantile columns.

Ellipsis
data (PointSet, BlockModel, Table or dict)

Where column names are looked up.

None

Returns:

Type Description
Table

category (sorted, then "all"), n, mean, variance, std, cv, min, max and one column per quantile named P10, P97.5, ...

used in