clean way prepend an element to a numpy array

greg greg at cosc.canterbury.ac.nz
Fri Jul 24 19:26:44 EDT 2009


Robert Kern wrote:

>> a[:0] = array('i', [0])
> 
> Not when 'a' is a numpy array rather than an array.array.

That's true, but I got the impression that the OP was
talking about array.array, not numpy.array.

It's very confusing having two widely-used types
both called 'array'. :-(

-- 
Greg



More information about the Python-list mailing list