convolve2d does 2d convolution of ‘data’ with ‘kernel’, storing the result in ‘output’.
>>> a = np.arange(20*20)
>>> a = a.reshape((20,20))
>>> b = np.ones((5,5), dtype=np.float64)
>>> rn = convolve2d(a, b, fft=0)
>>> rf = convolve2d(a, b, fft=1)
>>> np.alltrue(np.ravel(rn-rf<1e-10))
True