[Numpy-discussion] Quick Question about Optimization

Charles R Harris charlesr.harris at gmail.com
Mon May 19 18:27:32 EDT 2008


On Mon, May 19, 2008 at 2:53 PM, Christopher Barker <Chris.Barker at noaa.gov>
wrote:

> Anne Archibald wrote:
> > 2008/5/19 James Snyder <jbsnyder at gmail.com>:
> >> I can provide the rest of the code if needed, but it's basically just
> >> filling some vectors with random and empty data and initializing a few
> >> things.
> >
> > It would kind of help, since it would make it clearer what's a scalar
> > and what's an array, and what the dimensions of the various arrays
> > are.
>
> It would also help if you provided a complete example (as little code as
> possible), so we could try out and time our ideas before suggesting them.
>
> >> np.random.standard_normal(size=(1,self.naff))
>
> Anyone know how fast this is compared to Matlab? That could be the
> difference right there.
>

The latest versions of Matlab use the ziggurat method to generate random
normals and it is faster than the method used in numpy. I have ziggurat code
at hand, but IIRC, Robert doesn't trust the method ;) I don't know if it
would actually speed things up, though.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080519/3a70c94e/attachment.html>


More information about the NumPy-Discussion mailing list