std#
- class brainunit.math.std(x, axis=None, dtype=None, ddof=0, keepdims=False, *, where=None, **kwargs)#
Return the standard deviation of the array elements.
- Parameters:
x (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) – Input array.axis (
int|Sequence[int] |None) –Axis or axes along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array.
If this is a tuple of ints, a standard deviation is performed over multiple axes, instead of a single axis or all the axes as before.
dtype (
str|type[Any] |dtype|SupportsDType|None) – Type to use in computing the standard deviation. For arrays of integer type the default is float64, for arrays of float types it is the same as the array type.ddof (
int) – Means Delta Degrees of Freedom. The divisor used in calculations isN - ddof, whereNrepresents the number of elements. By default ddof is zero.keepdims (
bool) –If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
If the default value is passed, then keepdims will not be passed through to the std method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.
where (
Array|ndarray|bool|number|bool|int|float|complex|None) – Elements to include in the standard deviation. See ~numpy.ufunc.reduce for details.
- Returns:
out – Quantity if x is a Quantity, else an array.
- Return type:
saiunit.Quantity |
Array
Examples
>>> import saiunit as u >>> a = [1.0, 2.0, 3.0] * u.meter >>> u.math.std(a)