Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
np argmin top n
Plain_Dude_Sleeping_Alone
Programming language:
Python
2021-04-12 05:05:12
0
Q:
np argmin top n
Ankit
Code:
Python
2021-02-09 11:29:23
idx = (-arr).argsort()[:n]
2
Benjamin cooper
Code:
Python
2021-07-31 09:22:01
# For a 2D array indices = np.argpartition(arr, -N, axis=1)[:, -N:]
1
Related
np.zero
np.arange
numpy fill na with 0
python how to pad a numpy array with zeros
numpy subarray
sum of a numpy array
python numpy argmax
numpy vector shape
New to Communities?
Join the community