klyn.math.NDArray.variance
method
public variance(axis as Long, ddof as Long = 0l, keepDims as Boolean = false, ignoreNaN as Boolean = false, where as Boolean[] = null, result as NDArray<Double> = null) as NDArray<Double>
Description

Variance along the selected axes, without materializing slices.

Parameters
ParameterDescription
axisAxis to reduce; negative indices count from the end.
ddofNon-negative correction: divisor N-ddof; 0 population, 1 sample.
keepDimsKeep reduced dimensions with length one.
resultOptional non-aliased, shape-compatible destination reused without allocation.
ignoreNaNSkip NaNs; otherwise propagate them.
whereOptional flat Boolean mask, one entry per source element.
Returns

Reduced Double tensor.

Throws
  • ValueException for invalid parameters or no selected observations.
  • IndexException for an invalid axis.
Example

values = data.variance(axis=0)