Var / List Layer
Calculate the variance of numeric lists. Similar to numpy.var() or R's var(). Returns the sample (n-1) or population (n) variance. Supports lists of different lengths.
Mathematical definition: For a list of values with mean :
Population variance (ddof=0):
Sample variance (ddof=1):
Example transformation:
lists | variance (ddof=1) |
---|---|
[1, 2, 3, 4] | 1.667 |
[10, 10, 10] | 0.0 |
[1, null, 3, null] | 2.0 |
[2, 4, 6, 8, 10] | 10.0 |
[5] | null |
[] | null |
Common applications:
- Analyzing price volatility in financial data
- Measuring process stability in manufacturing
- Evaluating measurement precision in lab data
- Assessing performance consistency in systems
- Computing risk metrics in portfolio analysis
- Analyzing spread in experimental results
Note: Only works with numeric lists. Lists with fewer than 2 elements return null. Null values are ignored in calculation. The choice between population (ddof=0) and sample (ddof=1) depends on whether the data represents an entire population or a sample.
Select
columnThe variable-length numeric list column to analyze. Examples:
- Price series: [10.5, 11.2, 10.8, 11.5]
- Performance metrics: [85, 92, 88, 90]
- Sensor readings: [1.1, 1.2, 1.15]
- Response times: [0.1, 0.15, 0.12] Lists can have different lengths. Only numeric types supported.
Ddof
u8Delta Degrees of Freedom (DDOF
) affecting variance calculation:
- 1 (default): Sample variance ()
- 0: Population variance () Use 1 for sample analysis (more common), 0 when data represents entire population.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.