当我跑
from scipy.signal import convolve2d
convolve2d([[2, 2, 2], [1, 2, 3], [0, 1, 0]], [[0.5], [0.5]], 'valid')
我明白了
Warning (from warnings module):
File "C:\Program Files\Python 2.7\lib\site-packages\scipy\signal\signaltools.py", line 422
return sigtools._convolve2d(in1, in2, 1, val, bval, fillvalue)
ComplexWarning: Casting complex values to real discards the imaginary part
为什么会出现这种情况,如何正确预防?