On 12/03/15 at 05:39am, Eric Firing wrote: > On 2015/12/02 10:45 PM, Manolo Martínez wrote: > >1) this func sorts the absolute value of the amplitudes to find the two > >most important components, and this seems overkill for large vectors. > > Try > > inds = np.argpartition(-np.abs(ft), 2)[:2] > > Now inds holds the indices of the two largest components. >
That is better than sorted indeed. Thanks, M _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion