[Numpy-discussion] How to avoid extra copying when forming an array from an iterator
Fri Jun 24 11:58:27 CDT 2011
On Fri, Jun 24, 2011 at 9:12 AM, Robert Kern <firstname.lastname@example.org> wrote:
> On Fri, Jun 24, 2011 at 04:03, srean <email@example.com> wrote:
> > To answer my own question, I guess I can keep appending to a
> > object and get a numpy.array from its buffer if possible. Is that the
> > efficient way.
> It's one of the most efficient ways to do it, yes, especially for 1D
Thanks for the reply. My first cut was to try cStringIO because I thought I
could use the writelines() method and hence avoid the for loop in the python
code. It would have been nice if that had worked. If I understood it
correctly the looping would have been in a C function call.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion