Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
forループで2次元行列を埋めるこのPythonコードがあります
img=zeros((len(bins_x),len(bins_y))) for i in arange(0,len(ix)): img[ix[i]][iy[i]]=dummy[i]
コードの最後の 2 行にベクトル演算を使用することは可能ですか? また、計算を高速化するものはありますか?
ix、iy がインデックス シーケンスの場合:
img[ix, iy] = dummy