Skip to content

hbsir.calculate.weighted_average

Calculates the weighted average of the given columns.

Parameters:

Name Type Description Default
table DataFrame

The table to calculate the weighted average for.

required
weight_col str | None

The column to use as the weight, by default None

None
columns list[str] | None

The columns to calculate the weighted average for, by default None

None

Returns:

Type Description
Series

The weighted average of the given columns.