pyarrow.compute.variance#

pyarrow.compute.variance(array, /, *, ddof=0, skip_nulls=True, min_count=0, options=None, memory_pool=None)#

Calculate the variance of a numeric array.

The number of degrees of freedom can be controlled using VarianceOptions. By default (ddof = 0), the population variance is calculated. Nulls are ignored. If there are not enough non-null values in the array to satisfy ddof, null is returned.

Parameters
arrayArray-like

Argument to compute function.

ddofint, default 0

Number of degrees of freedom.

skip_nullsbool, default True

Whether to skip (ignore) nulls in the input. If False, any null in the input forces the output to null.

min_countint, default 0

Minimum number of non-null values in the input. If the number of non-null values is below min_count, the output is null.

optionspyarrow.compute.VarianceOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.