ValueError: object too deep for desired array while using convolution

前端 未结 4 1360
既然无缘
既然无缘 2020-12-15 15:24

I\'m trying to do this:

h = [0.2,0.2,0.2,0.2,0.2]

Y = np.convolve(Y, h, \"same\")

Y looks like this:

4条回答
  •  离开以前
    2020-12-15 16:06

    np.convolve() takes one dimension array. You need to check the input and convert it into 1D.

    You can use the np.ravel(), to convert the array to one dimension.

提交回复
热议问题