[Numpy-discussion] Problem with correlate

Stéfan van der Walt stefan at sun.ac.za
Mon May 18 08:38:37 EDT 2009


2009/5/18 rob steed <rjsteed at talk21.com>:
> This works fine. However, if the arrays have different lengths, we get a problem.
>
>>>> y2=N.array([0,0,0,1])
>>>> N.correlate(x,y2,'full')

This looks like a bug to me.

In [54]: N.correlate([1, 0, 0, 0], [0, 0, 0, 1],'full')
Out[54]: array([1, 0, 0, 0, 0, 0, 0])

In [55]: N.correlate([1, 0, 0, 0, 0], [0, 0, 0, 1],'full')
Out[55]: array([1, 0, 0, 0, 0, 0, 0, 0])

In [56]: N.correlate([1, 0, 0, 0, 0], [0, 0, 0, 0, 1],'full')
Out[56]: array([1, 0, 0, 0, 0, 0, 0, 0, 0])

In [57]: N.correlate([1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1],'full')
Out[57]: array([0, 0, 0, 0, 0, 0, 0, 0, 0, 1])

Regards
Stéfan



More information about the NumPy-Discussion mailing list