numpy get index of n largest values

Solutions on MaxInterview for numpy get index of n largest values by the best coders in the world

showing results for - "numpy get index of n largest values"
Kari
21 Mar 2016
1numbers = np.array([1, 3, 2, 4])
2n = 2
3indices = (-numbers).argsort()[:n]