> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# var()

<span id="atoti.array.var" />

> atoti.array.var(<br />
>     *measure*: VariableMeasureConvertible,<br />
>     /,<br />
>     \*,<br />
>     *mode*: [Literal](https://docs.python.org/3/library/typing.html#typing.Literal)\['sample', 'population'] = `'sample'`,<br />
> ) → MeasureDefinition

Return a measure equal to the variance of the elements of the passed array measure.

### Parameters

<h4 id="atoti.array.var.measure">
  *measure*
</h4>

The measure to get the variance of.

<h4 id="atoti.array.var.mode">
  *mode*
</h4>

One of the supported modes:

* The `sample` variance, similar to Excel’s `VAR.S`, is $\frac{\sum_{i=1}^{n} (X_i - m)^{2}}{n - 1}$ where `m` is the sample mean and `n` the size of the sample.
  Use this mode if the data represents a sample of the population.
* The `population` variance, similar to Excel’s `VAR.P` is $\frac{\sum_{i=1}^{n}(X_i - m)^{2}}{n}$ where `m` is the mean of the `Xi` elements and `n` the size of the population.
  Use this mode if the data represents the entire population.
