kernel = np.array([[1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 /
    9, 1 / 9]])
avg_data = ndimage.convolve(data, kernel)
smaller_data = scipy.misc.imresize(avg_data, org_size / 3, interp='nearest',
    mode=None)
Summing each 3x3 window of a M*N matrix, into a M/3*N/3 matrix with numpy