argmax and argmin
argminxf(x) is the value of x for which f(x) attains it’s minimum.
argmaxxf(x) is the value of x for which f(x) attains it’s maximum.
ARGMIN AND ARGMAX returns Indices of the minimum and maximum values along an axis.
|a (array_like)||Input array.|
|axis (int, optional)||By default, the index is into the flattened array, otherwise along the specified axis.|
|index_array (ndarray of ints)||Array of indices into the array. It has the same shape as a.shape with the dimension along axis removed.|
>>> from numpy import * >>> a = [[1,2,4],[6,3,8],[9,6,1]] >>> argmax(a) 6 >>> argmin(a) 0