[Numpy-discussion] appending extra items to arrays

Robert Kern robert.kern at gmail.com
Thu Oct 11 00:52:33 EDT 2007


Adam Mercer wrote:
> Hi
> 
> In some code I have, I need to append some extra data to a given
> array.  At the moment I construct the data in a list, append the extra
> information I need and then convert the final list to an array.  Is
> there a way that I can append extra information to an existing array
> thereby negating the need for the list, as the array object doesn't
> seem to have an append() method?

Appending to a list then converting the list to an array is the most
straightforward way to do it. If the performance of this isn't a problem, I
recommend leaving it alone.

-- 
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