[Numpy-discussion] concatenate trouble

Robert Cimrman cimrman3@ntc.zcu...
Fri Jan 30 10:28:59 CST 2009


Neal Becker wrote:
> What's the problem here?
> 
>  print np.concatenate (np.ones (10, dtype=complex), np.zeros (10, 
> dtype=complex))
> TypeError: only length-1 arrays can be converted to Python scalars

You should enclose the arrays you concatenate into a tuple: 
np.concatenate((a,b)).

r.


More information about the Numpy-discussion mailing list