pyarrow.compute.variance

pyarrow.compute.variance(array, *, memory_pool=None, options=None, ddof=0)

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
  • array (Array-like) – Argument to compute function

  • memory_pool (pyarrow.MemoryPool, optional) – If not passed, will allocate memory from the default memory pool.

  • options (pyarrow.compute.VarianceOptions, optional) – Parameters altering compute function semantics

  • **kwargs (optional) – Parameters for VarianceOptions constructor. Either options or **kwargs can be passed, but not both at the same time.