Back to Numerical Arrays (NumPy)
np.variance
Compute the variance along the specified axis.
Syntax
np.variance(a, axis?, ddof?, keepdims?, dtype?)
Description
Compute the variance along the specified axis.
Parameters
| Name | Description |
|---|---|
| a | - Input array |
| axis(optional) | - Axis along which to compute variance. null computes variance of all elements. |
| ddof(optional) | - Delta Degrees of Freedom. Divisor is N - ddof. Default: 0 (population variance) |
| keepdims(optional) | - If true, reduced axes are left with size 1 |
| dtype(optional) | - Output dtype |
Returns
Promise<NDArray | number>