Jens
0
Q:

how to get index of max n values in an array

In [1]: import numpy as np

In [2]: arr = np.array([1, 3, 2, 4, 5])

In [3]: arr.argsort()[-3:][::-1]
Out[3]: array([4, 3, 1])
0

New to Communities?

Join the community