I know I can do it like the following:
import numpy as npN=10a=np.arange(1,100,1)np.argsort()[-N:]
However, it is very slow since it did a full sort.
I wonder whether numpy provide some methods the do it fast.
I know I can do it like the following:
import numpy as npN=10a=np.arange(1,100,1)np.argsort()[-N:]
However, it is very slow since it did a full sort.
I wonder whether numpy provide some methods the do it fast.