dpnp.minimum
- dpnp.minimum(x1, x2, out=None, where=True, order='K', dtype=None, subok=True, **kwargs)
Compares two input arrays x1 and x2 and returns a new array containing the element-wise minima.
For full documentation refer to
numpy.minimum
.- Parameters:
x1 ({dpnp.ndarray, usm_ndarray}) -- First input array, expected to have numeric data type.
x2 ({dpnp.ndarray, usm_ndarray}) -- Second input array, also expected to have numeric data type.
out ({None, dpnp.ndarray}, optional) -- Output array to populate. Array must have the correct shape and the expected data type.
order ({"C", "F", "A", "K"}, optional) -- Memory layout of the newly output array, if parameter out is
None
. Default: "K".
- Returns:
out -- An array containing the element-wise minima. The data type of the returned array is determined by the Type Promotion Rules.
- Return type:
dpnp.ndarray
Limitations
Parameters where and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise
NotImplementedError
exception will be raised.See also
dpnp.maximum
Element-wise maximum of two arrays, propagates NaNs.
dpnp.fmin
Element-wise minimum of two arrays, ignores NaNs.
dpnp.min
The minimum value of an array along a given axis, propagates NaNs.
dpnp.nanmin
The minimum value of an array along a given axis, ignores NaNs.
dpnp.fmax
Element-wise maximum of two arrays, ignores NaNs.
dpnp.max
The maximum value of an array along a given axis, propagates NaNs.
dpnp.nanmax
The maximum value of an array along a given axis, ignores NaNs.
Examples
>>> import dpnp as np >>> x1 = np.array([2, 3, 4]) >>> x2 = np.array([1, 5, 2]) >>> np.minimum(x1, x2) array([1, 3, 2])
>>> x1 = np.eye(2) >>> x2 = np.array([0.5, 2]) >>> np.minimum(x1, x2) # broadcasting array([[0.5, 0. ], [0. , 1. ]]
>>> x1 = np.array([np.nan, 0, np.nan]) >>> x2 = np.array([0, np.nan, np.nan]) >>> np.minimum(x1, x2) array([nan, nan, nan])
>>> np.minimum(np.array(-np.Inf), 1) array(-inf)