Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- # argmin returns the first encountered index having the minimum
- d = np.array([3,2,1,3,2,1,3]
- np.argmin(d)
- # why?
- # take a look at the help of argmin() ' "Notes" section
- help(np.argmin)
- # Notes
- # -----
- # In case of multiple occurrences of the minimum values, the indices
- # corresponding to the first occurrence are returned.
- np.where(d == d.min()) # will work
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement