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.
3次元配列があります。たとえば、dat.shape =(100,128,256)です。最初の軸で10.0より大きい値を持つ期間の数を数えようとしています。たとえば、dat [:、0,0]の場合、10.0より大きい値は何回発生しますか?次に、dat [:、0,1]からdat [:、n、m]へ。私のエンドマトリックスは(128,156)の形になります。
1次元と2次元をループせずに、numpyまたはscipyでこの計算を行う方法はありますか?
どうもありがとうございます!
import numpy as np a = np.random.randint(0, 100, (100,128,256)) np.sum(a > 10, axis=0)