How do I solve this?
Thanks
Prashant
________________________________
From: Gael Varoquaux <[email protected]>
To: Discussion of Numerical Python <[email protected]>
Sent: Thursday, 18 December, 2008 4:03:34 PM
Subject: Re: [Numpy-discussion] array not appending
On Thu, Dec 18, 2008 at 03:52:23PM +0530, Prashant Saxena wrote:
> In [43]: ST = np.empty([], dtype=np.float32)
> In [44]: np.append(ST, 10.0)
> Out[44]: array([ 3.83333603e-38, 1.00000000e+01])
> In [45]: np.append(ST, 10.0)
> Out[45]: array([ 3.83333603e-38, 1.00000000e+01])
> In [46]: print ST
> 3.83333602707e-038
> What's wrong here?
Nothing. If you look at the documentation, np.append does not modify
in place the array.:
'''
Returns
-------
out : ndarray
A copy of `arr` with `values` appended to `axis`. Note that `append`
does not occur in-place: a new array is allocated and filled.
'''
Modification in place is not possible with the numpy model of an array.
Gaƫl
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion