Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy get index of n largest values

numbers = np.array([1, 3, 2, 4])
n = 2
indices = (-numbers).argsort()[:n]
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #numpy #index #largest #values
ADD COMMENT
Topic
Name
4+5 =