[Numpy-discussion] in place random generation

Matthew Brett matthew.brett@gmail....
Fri Mar 9 13:12:17 CST 2007


Oh dear, sorry, I should have read your email more carefully.

Matthew

On 3/8/07, Daniel Mahler <dmahler@gmail.com> wrote:
> On 3/8/07, Matthew Brett <matthew.brett@gmail.com> wrote:
> > > > My problem is not space, but time.
> > > > I am creating a small array over and over,
> > > > and this is turning out to be a bottleneck.
> >
> > How about making one large random number array and taking small views?
> >
>
> How is that different from:
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++
> Allocating all the arrays as one n+1  dim and grabbing rows from it
> is faster than allocating the small arrays individually.
> I am iterating too many times to allocate everything at once though.
> I can just do a nested loop
> where create manageably large arrays in the outer
> and grab the rows in the inner,
> but I wanted something cleaner.
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>
>  later in the post
>
> > Matthew
>
> Daniel
>
> > _______________________________________________
> > Numpy-discussion mailing list
> > Numpy-discussion@scipy.org
> > http://projects.scipy.org/mailman/listinfo/numpy-discussion
> >
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the Numpy-discussion mailing list