Advertisement
Guest User

Untitled

a guest
May 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import numpy as np
  2. # argmin returns the first encountered index having the minimum
  3. d = np.array([3,2,1,3,2,1,3]
  4. np.argmin(d)
  5. # why?
  6. # take a look at the help of argmin() ' "Notes" section
  7. help(np.argmin)
  8. # Notes
  9. # -----
  10. # In case of multiple occurrences of the minimum values, the indices
  11. # corresponding to the first occurrence are returned.
  12.  
  13. np.where(d == d.min()) # will work
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement