-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Torgil Svensson wrote:

> My original problem was to get an moving average and a moving standard
> deviation (120k rows and N=1000). For average I guess convolve should
> perform good, but is there anything smart for std()? For now I use ...
> 
>>>> moving_std=array([a[i:i+n].std() for i in range(len(a)-n)])
> 
> which seems to perform quite well.

You can always look for more fancy and unreadable solutions, but since
this one has the inner loop with a reasonable vector length (1000) coded
 in C, one can guess that the performance will be reasonable. I would
start looking for alternatives only if N drops significantly, say to <50.

Rob

- --
Rob W.W. Hooft  ||  [EMAIL PROTECTED]  ||  http://www.hooft.net/people/rob/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE8T/QH7J/Cv8rb3QRAtutAKCikJ1qLbedU4pNl7ZohHCLEAWVKACgji9R
6evNgk6R68/JnimUs4OOd98=
=htbE
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to