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.
私は形状の 2-D numpy 配列を持っており(256,128)、256 の 8 行ごとに平均化したいので、形状の numpy 配列に(32,128)なります。1 つの次元だけを平均化する方法はありますか?
(256,128)
(32,128)
for ループの使用
[m, n ] = shape(Array) meanArray = zeros((m/8, n)) for i in range(0, m/8): f = i*8 meanArray[i, :] = numpy.mean(Array[f:f+8, :], axis=1)