def conv2(A, size):
    return signal.convolve2d(A, np.ones((size, size)), mode='same') / float(
        size ** 2)

def fftconv(A, size):
    pass
Numpy: Replace every value in the array with the mean of its adjacent elements