NP Argmin Top n
idx = (-arr).argsort()[:n]
Bored Coder
idx = (-arr).argsort()[:n]
# For a 2D array
indices = np.argpartition(arr, -N, axis=1)[:, -N:]