1000x1000
)只有几个因素与我有关。假设这些元素是
>1000
目前,我有两种不同的方法,它们的复杂性应该是相同的(我省略了可能的解决方案)
for
import numpy as np
A = np.zeros((1000,1000))
#do something with the matrix
#first solution with np.where
np.where(A > 999).T
# array([[0, 0],[1, 20]....[785, 445]], dtype=int64) - made up numbers
#another solution with np.argwhere
np.argwhere(A > 999)
# array([[0, 0],[1, 20]....[785, 445]], dtype=int64) - outputs the same
有没有任何可能的方法来加速这个搜索或者我的解决方案是最有效的?
谢谢你的建议和建议!