std
Calculates the standard deviation of the input array x
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
input array of a real-valued floating-point data type. |
required | |
axis
|
axis or axes along which standard deviations are computed.
By default, the standard deviation is computed over the entire array.
If a tuple of integers, standard deviations are computed over multiple axes.
Default: |
None
|
|
correction
|
degrees of freedom adjustment.
Setting this parameter to a value other than |
0.0
|
|
keepdims
|
if |
False
|
Returns:
Name | Type | Description |
---|---|---|
out |
array
|
if the standard deviation was computed over the entire array, a zero-dimensional array containing
the standard deviation; otherwise, a non-zero-dimensional array containing the standard deviations.
The returned array has the same data type as |
Special Cases
Let N
equal the number of elements over which to compute the standard deviation.
- If
N - correction
is less than or equal to0
, the standard deviation isNaN
. - If
x_i
isNaN
, the standard deviation isNaN
(i.e.,NaN
values propagate).
Examples:
>>> a = sparse.COO.from_numpy(np.array([[0, 2], [-1, 1]]))
>>> o = sparse.std(a, axis=1)
>>> o.todense()
array([1., 1.])
Source code in sparse/numba_backend/_common.py
2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 |
|