numpy get index of n largest values code example
Example: numpy get index of n largest values
numbers = np.array([1, 3, 2, 4])
n = 2
indices = (-numbers).argsort()[:n]
numbers = np.array([1, 3, 2, 4])
n = 2
indices = (-numbers).argsort()[:n]