Loading...

vastorbit.VastColumn.var

VastColumn.var() Annotated[bool | float | str | timedelta | datetime, 'Python Scalar']

Aggregates the VastFrame using VAR aggregation (Variance), providing insights into the spread or variability of data for the input column. The variance is a measure of how much individual data points deviate from the mean, helping to assess data consistency and variation.

Returns:

variance

Return type:

PythonScalar

Examples

For this example, let’s generate a dataset and calculate the variance of a column:

import vastorbit as vo

data = vo.VastFrame(
    {
        "x": [1, 2, 4, 9, 10, 15, 20, 22],
        "y": [1, 2, 1, 2, 1, 1, 2, 1],
        "z": [10, 12, 2, 1, 9, 8, 1, 3],
    }
)
data["x"].sum()

Note

All the calculations are pushed to the database.

Hint

For more precise control, please refer to the aggregate method.

See also

VastColumn.aggregate() : Aggregations for a specific column.
VastFrame.aggregate() : Aggregates for particular columns.