Skip to content

Latest commit

 

History

History
55 lines (13 loc) · 275 Bytes

topk.md

File metadata and controls

55 lines (13 loc) · 275 Bytes

Top K

⌚️:2020年11月30日

📚参考


In [1]: import numpy as np

In [2]: arr = np.array([1, 3, 2, 4, 5])

In [3]: arr.argsort()[-3:][::-1]
Out[3]: array([4, 3, 1])