jax.numpy.nanargminΒΆ
-
jax.numpy.
nanargmin
(a, axis=None)[source]ΒΆ Return the indices of the minimum values in the specified axis ignoring NaNs. For all-NaN slices
ValueError
is raised. Warning: the results cannot be trusted if a slice contains only NaNs and Infs.LAX-backend implementation of
nanargmin()
. Warning: jax.numpy.argmin returns -1 for all-NaN slices and does not raise an error.Original docstring below.
- Parameters
a (array_like) β Input data.
axis (int, optional) β Axis along which to operate. By default flattened input is used.
- Returns
index_array β An array of indices or a single index value.
- Return type
See also
Examples
>>> a = np.array([[np.nan, 4], [2, 3]]) >>> np.argmin(a) 0 >>> np.nanargmin(a) 2 >>> np.nanargmin(a, axis=0) array([1, 1]) >>> np.nanargmin(a, axis=1) array([1, 0])