[Numpy-discussion] How to avoid extra copying when forming an array from an iterator

Robert Kern robert.kern at gmail.com
Fri Jun 24 10:12:18 EDT 2011


On Fri, Jun 24, 2011 at 04:03, srean <srean.list at gmail.com> wrote:
> To answer my own question, I guess I can keep appending to a array.array()
> 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 arrays.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the NumPy-Discussion mailing list