Element-wise minimum of array elements.
Compare two arrays and returns a new array containing the element-wise minima.
Parameters: | x1, x2 : array_like
|
---|---|
Returns: | y : {ndarray, scalar}
|
See also
Notes
Equivalent to np.where(x1 < x2, x1, x2) but faster and does proper broadcasting.
Examples
>>> np.minimum([2, 3, 4], [1, 5, 2])
array([1, 3, 2])
>>> np.minimum(np.eye(2), [0.5, 2])
array([[ 0.5, 0. ],
[ 0. , 1. ]])