# COO.min¶

COO.min(axis=None, keepdims=False, out=None)[source]

Minimize along the given axes. Uses all axes by default.

Parameters: axis (Union[int, Iterable[int]], optional) – The axes along which to minimize. Uses all axes by default. keepdims (bool, optional) – Whether or not to keep the dimensions of the original array. dtype (numpy.dtype) – The data type of the output array. The reduced output sparse array. COO

numpy.min
Equivalent numpy function.
scipy.sparse.coo_matrix.min()
Equivalent Scipy function.
nanmin
Function with NaN skipping.

Notes

• This function internally calls COO.sum_duplicates to bring the array into canonical form.
• The out parameter is provided just for compatibility with Numpy and isn’t actually supported.

Examples

You can use COO.min to minimize an array across any dimension.

>>> x = np.add.outer(np.arange(5), np.arange(5))
>>> x  # doctest: +NORMALIZE_WHITESPACE
array([[0, 1, 2, 3, 4],
[1, 2, 3, 4, 5],
[2, 3, 4, 5, 6],
[3, 4, 5, 6, 7],
[4, 5, 6, 7, 8]])
>>> s = COO.from_numpy(x)
>>> s2 = s.min(axis=1)
>>> s2.todense()  # doctest: +NORMALIZE_WHITESPACE
array([0, 1, 2, 3, 4])


You can also use the keepdims argument to keep the dimensions after the minimization.

>>> s3 = s.min(axis=1, keepdims=True)
>>> s3.shape
(5, 1)


By default, this reduces the array down to one boolean, minimizing along all axes.

>>> s.min()
0