Loading...

verticapy.vDataColumn.count#

vDataColumn.count() int#

This operation aggregates the vDataFrame using the COUNT aggregation, providing the count of non-missing values for the input column. This is valuable for assessing data completeness and quality.

Returns#

int

number of non-Missing elements.

Examples#

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

import verticapy as vp

data = vp.vDataFrame(
    {
        "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"].count()
Out[3]: 8.0

Note

All the calculations are pushed to the database.

Hint

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

See also

vDataFrame.count() : Count for particular columns.
vDataFrame.count_percent() :

Percentage count for particular columns.