- nlcpy.argmin(a, axis=None, out=None)
Returns the indices of the minimum values along an axis.
- axisint, optional
By default, the index is into the flattened array, otherwise along the specified axis.
- outndarray, optional
If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype.
- index_arrayndarray of ints
Array of indices into the array. It has the same shape as a.shape with the dimension along axis removed.
In case of multiple occurrences of the minimum values, the indices corresponding to the first occurrence are returned.
>>> import nlcpy as vp >>> a = vp.arange(6).reshape(2,3) + 10 >>> a array([[10, 11, 12], [13, 14, 15]]) >>> vp.argmin(a) array(0) >>> vp.argmin(a, axis=0) array([0, 0, 0]) >>> vp.argmin(a, axis=1) array([0, 0])
>>> b = vp.arange(6) + 10 >>> b = 10 >>> b array([10, 11, 12, 13, 10, 15]) >>> vp.argmin(b) # Only the first occurrence is returned. array(0)