min
Calculates the minimum value of the input array x
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
input array. Should have a real-valued data type. |
required | |
axis
|
axis or axes along which minimum values are computed.
By default, the minimum value must be computed over the entire array.
If a tuple of integers, minimum values must be computed over multiple axes. Default: |
None
|
|
keepdims
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
out |
array
|
if the minimum value was computed over the entire array, a zero-dimensional array containing the minimum value.
Otherwise, a non-zero-dimensional array containing the minimum values.
The returned array must have the same data type as |
Special Cases
For floating-point operands, if x_i
is NaN
, the minimum value is NaN
(i.e., NaN
values propagate).
Examples:
>>> a = sparse.COO.from_numpy(np.array([[0, -1], [-2, 0]]))
>>> o = sparse.min(a, axis=1)
>>> o.todense()
array([-1, -2])
Source code in sparse/numba_backend/_common.py
2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 |
|