array = np.array([9, 4, 4, 3, 3, 9, 0, 4, 6, 0]) # n highest value n = 5 # Index of n highest value ind = np.argpartition(a, -n)[-n:] ind array([1, 5, 8, 0]) # n highest value top4 = a[ind] top4 array([4, 9, 6, 9])