[Numpy-discussion] numpy.append and persisting original datatype

Benjamin Root ben.root at ou.edu
Sat Jul 24 22:08:09 EDT 2010


On Sat, Jul 24, 2010 at 4:14 PM, Martin Galpin <galpin at gmail.com> wrote:

> Hello,
>
> 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
>
> --
> Martin
>
>
I have moved this over to the numpy-discussion list.

Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100724/f3e79cda/attachment.html>


More information about the NumPy-Discussion mailing list