DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR TYPESCRIPT
get top elements from a list python
import numpy as np top_2_idx = np.argsort(a)[-2:] top_2_values = [a[i] for i in top_2_idx]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#top
#elements
#list
#python
ADD COMMENT
Topic
COMMENT
Name
2+9 =
Submit