Loading...

vastorbit.VastColumn.avg

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

This operation aggregates the VastFrame using the AVG aggregation, which calculates the average value for the input column. It provides insights into the central tendency of the data and is a fundamental statistical measure often used in data analysis and reporting.

Returns:

average

Return type:

PythonScalar

Examples

For this example, let’s generate a dataset and calculate the average 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"].avg()

Note

All the calculations are pushed to the database.

Hint

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

See also

VastFrame.avg() : Aggregations for particular columns.
VastFrame.max() : Maximum for particular columns.
VastFrame.min() : Minimum for particular columns.