I have an array and I want to find the indices of the maximum values.
For example:
myarray = np.array([1,8,8,3,2])
I want to get the result: [1,2], how can I do that?
(Actually I tried np.argmax(myarray), but it only return the first occurrence [1])
max()to find the maximum value, thennumpy.where()to find all the indexes with that value.np.where(myarray==myarray[np.argmax(myarray)])works...