MCPcopy Index your code
hub / github.com/numpy/numpy / nanmin

Function nanmin

numpy/lib/_nanfunctions_impl.py:253–374  ·  view source on GitHub ↗

Return minimum of an array or minimum along an axis, ignoring any NaNs. When all-NaN slices are encountered a ``RuntimeWarning`` is raised and Nan is returned for that slice. Parameters ---------- a : array_like Array containing numbers whose minimum is desired. If

(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
           where=np._NoValue)

Source from the content-addressed store, hash-verified

251
252@array_function_dispatch(_nanmin_dispatcher)
253def nanmin(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
254 where=np._NoValue):
255 """
256 Return minimum of an array or minimum along an axis, ignoring any NaNs.
257 When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
258 Nan is returned for that slice.
259
260 Parameters
261 ----------
262 a : array_like
263 Array containing numbers whose minimum is desired. If `a` is not an
264 array, a conversion is attempted.
265 axis : {int, tuple of int, None}, optional
266 Axis or axes along which the minimum is computed. The default is to compute
267 the minimum of the flattened array.
268 out : ndarray, optional
269 Alternate output array in which to place the result. The default
270 is ``None``; if provided, it must have the same shape as the
271 expected output, but the type will be cast if necessary. See
272 :ref:`ufuncs-output-type` for more details.
273 keepdims : bool, optional
274 If this is set to True, the axes which are reduced are left
275 in the result as dimensions with size one. With this option,
276 the result will broadcast correctly against the original `a`.
277
278 If the value is anything but the default, then
279 `keepdims` will be passed through to the `min` method
280 of sub-classes of `ndarray`. If the sub-classes methods
281 does not implement `keepdims` any exceptions will be raised.
282 initial : scalar, optional
283 The maximum value of an output element. Must be present to allow
284 computation on empty slice. See `~numpy.ufunc.reduce` for details.
285
286 .. versionadded:: 1.22.0
287 where : array_like of bool, optional
288 Elements to compare for the minimum. See `~numpy.ufunc.reduce`
289 for details.
290
291 .. versionadded:: 1.22.0
292
293 Returns
294 -------
295 nanmin : ndarray
296 An array with the same shape as `a`, with the specified axis
297 removed. If `a` is a 0-d array, or if axis is None, an ndarray
298 scalar is returned. The same dtype as `a` is returned.
299
300 See Also
301 --------
302 nanmax :
303 The maximum value of an array along a given axis, ignoring any NaNs.
304 amin :
305 The minimum value of an array along a given axis, propagating any NaNs.
306 fmin :
307 Element-wise minimum of two arrays, ignoring any NaNs.
308 minimum :
309 Element-wise minimum of two arrays, propagating any NaNs.
310 isnan :

Callers

nothing calls this directly

Calls 5

_replace_nanFunction · 0.85
_copytoFunction · 0.85
reduceMethod · 0.45
anyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…