Re: [Numpy-discussion] fromiter shape argument -- was Re: For loop tips

2006-08-31 Thread Tim Hochberg
Torgil Svensson wrote: >> Yes. fromiter(iterable, dtype, count) works. >> > > Oh. Thanks. I probably had too old documentation to see this (15 > June). If it's not updated since I'll give Travis a rest about this, > at least until 1.0 is released :) > Actually I just knew 'cause I wrote it.

Re: [Numpy-discussion] fromiter shape argument -- was Re: For loop tips

2006-08-31 Thread Torgil Svensson
> Yes. fromiter(iterable, dtype, count) works. Oh. Thanks. I probably had too old documentation to see this (15 June). If it's not updated since I'll give Travis a rest about this, at least until 1.0 is released :) > Regardless, L is only iterated over once. How can this be true? If no size is

Re: [Numpy-discussion] fromiter shape argument -- was Re: For loop tips

2006-08-30 Thread Tim Hochberg
Torgil Svensson wrote: >>return uL,asmatrix(fromiter((idx[x] for x in L),dtype=int)) >> > > Is it possible for fromiter to take an optional shape (or count) > argument in addition to the dtype argument? Yes. fromiter(iterable, dtype, count) works. > If both is given it could > preallocat