我们知道当N = 1时该怎么做
import numpy as np
m = np.arange(15).reshape(3, 5)
m[xrange(len(m)), m.argmax(axis=1)] # array([ 4, 9, 14])
Run Code Online (Sandbox Code Playgroud)
当N> 1时,获得最高N的最佳方法是什么?(比方说5)
| 归档时间: |
|
| 查看次数: |
1251 次 |
| 最近记录: |