[Numpy-discussion] Problem with correlate?

Hanno Klemm klemm@phys.ethz...
Fri Aug 22 02:44:05 CDT 2008


Hi Stefan,

yes, indeed, that's what I thought. This result is odd. Has correlate
been changed since version 1.0.4, or should I submit this as a bug?

Best regards,
Hanno

Stéfan van der Walt <stefan@sun.ac.za> said:

> ------=_Part_25307_10322093.1219268954678
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: inline
> 
> 2008/8/20 Hanno Klemm <klemm@phys.ethz.ch>:
> > In [29]: x =3D array([0.,0.,1, 0, 0])
> > In [35]: y1 =3D array([1,0,0,0,0])
> >
> > In [36]: correlate(x,y1,mode=3D'full')
> > Out[36]: array([ 0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.])
> 
> That doesn't look right.  Under r5661:
> 
> In [60]: np.convolve([0, 0, 1, 0, 0], [1, 0, 0, 0, 0], mode=3D'f')
> Out[60]: array([0, 0, 1, 0, 0, 0, 0, 0, 0])
> 
> Regards
> St=E9fan
> 
> ------=_Part_25307_10322093.1219268954678
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: inline
> 
> <div dir=3D"ltr">2008/8/20 Hanno Klemm &lt;<a
href=3D"mailto:klemm@phys.eth=
> z.ch">klemm@phys.ethz.ch</a>&gt;:<br>&gt; In [29]: x =3D
array([0.,0.,1, 0,=
>  0])<br>&gt; In [35]: y1 =3D array([1,0,0,0,0])<br>&gt;<br>&gt; In
[36]: co=
> rrelate(x,y1,mode=3D&#39;full&#39;)<br>
> &gt; Out[36]: array([ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,
&nbsp;0.,=
>  &nbsp;1., &nbsp;0., &nbsp;0.])<br><br>That doesn&#39;t look
right.&nbsp; U=
> nder r5661:<br><br>In [60]: np.convolve([0, 0, 1, 0, 0], [1, 0, 0,
0, 0], m=
> ode=3D&#39;f&#39;)<br>Out[60]: array([0, 0, 1, 0, 0, 0, 0, 0, 0])<br>
> <br>Regards<br>St=E9fan<br><br></div>
> 
> ------=_Part_25307_10322093.1219268954678--
> 



-- 
Hanno Klemm
klemm@phys.ethz.ch




More information about the Numpy-discussion mailing list