You can reshape array first reshape that each line is one of a group of 50 elements, then apply np.mean to each of these lines, and then change shape again.
>>> a = np.array([range(1000), range(1000), range(1000)]) >>> b = np.reshape(a, (60, 50)) >>> c = np.apply_along_axis(np.mean, 1, b) >>> np.reshape(c, (3, 20)) array([[ 24.5, 74.5, 124.5, 174.5, 224.5, 274.5, 324.5, 374.5, 424.5, 474.5, 524.5, 574.5, 624.5, 674.5, 724.5, 774.5, 824.5, 874.5, 924.5, 974.5], [ 24.5, 74.5, 124.5, 174.5, 224.5, 274.5, 324.5, 374.5, 424.5, 474.5, 524.5, 574.5, 624.5, 674.5, 724.5, 774.5, 824.5, 874.5, 924.5, 974.5], [ 24.5, 74.5, 124.5, 174.5, 224.5, 274.5, 324.5, 374.5, 424.5, 474.5, 524.5, 574.5, 624.5, 674.5, 724.5, 774.5, 824.5, 874.5, 924.5, 974.5]])