[SciPy-User] numpy.append and persisting original datatype

Martin Galpin galpin@gmail....
Sat Jul 24 16:14:55 CDT 2010


Given the following example:

import numpy as np
foo = np.array([], dtype=np.float32)
print a.dtype
>> float32
foo = np.append(foo, 1)
print foo.dtype
>> float64

Is this the correct behaviour? I realise that numpy.append() returns a new
copy of foo but is it the correct behaviour that the original datatype is
not persisted? If so, should this not be noted in the documentation?

Forgive me if I have missed something.

Best wishes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100724/d6e551f7/attachment.html 

More information about the SciPy-User mailing list