a guest May 21st, 2019 61 Never
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]
- # why?
- # take a look at the help of argmin() ' "Notes" section
- # 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
RAW Paste Data