[Numpy-discussion] ANNOUNCE: EPD Py25 v4.1.30101_beta2 available for testing

2008-12-18 Thread Dave Peterson
Hello, The Enthought Python Distribution's (EPD) early access program website is now hosting the beta 2 build of the upcoming EPD Py25 v4.1.301 release. We would very much appreciate your assistance in making EPD as stable and reliable as possible! Please join us in our efforts by downloading

[Numpy-discussion] array not appending

2008-12-18 Thread Prashant Saxena
Hi, This is copied from ipython console. In [42]: import numpy as np In [43]: ST = np.empty([], dtype=np.float32) In [44]: np..append(ST, 10.0) Out[44]: array([ 3.8603e-38, 1.e+01]) In [45]: np.append(ST, 10.0) Out[45]: array([ 3.8603e-38, 1.e+01]) In [46]:

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Gael Varoquaux
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.8603e-38, 1.e+01]) In [45]: np.append(ST, 10.0) Out[45]: array([ 3.8603e-38, 1.e+01])

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Prashant Saxena
How do I solve this? Thanks Prashant From: Gael Varoquaux gael.varoqu...@normalesup.org To: Discussion of Numerical Python numpy-discussion@scipy.org Sent: Thursday, 18 December, 2008 4:03:34 PM Subject: Re: [Numpy-discussion] array not appending On Thu, Dec

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Gael Varoquaux
On Thu, Dec 18, 2008 at 04:19:20PM +0530, Prashant Saxena wrote: How do I solve this? If you want appending in place you have to use a python list. If you don't need modification in place, np.append returns an array with the appended number. Gaƫl

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Prashant Saxena
ST = np.empty((), dtype=np.float32) ST = np.append(ST, 10.0) This works, is it proper way to do so? One more prob ST.size returns 2. Why? I have added only one element. Prashant From: Gael Varoquaux gael.varoqu...@normalesup.org To: Discussion of

Re: [Numpy-discussion] array not appending

2008-12-18 Thread David Cournapeau
Prashant Saxena wrote: ST = np.empty((), dtype=np.float32) ST = np.append(ST, 10.0) This works, is it proper way to do so? One more prob ST.size returns 2. Why? I have added only one element. You added one element to an array which as already one element. Empty does not mean that the

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Sebastian Haase
On Thu, Dec 18, 2008 at 11:44 AM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Prashant Saxena wrote: ST = np.empty((), dtype=np.float32) ST = np.append(ST, 10.0) This works, is it proper way to do so? One more prob ST.size returns 2. Why? I have added only one element. You

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Alan G Isaac
On 12/18/2008 5:56 AM Prashant Saxena apparently wrote: ST = np.empty((), dtype=np.float32) ST = np.append(ST, 10.0) If you really need to append elements, you probably want to use a list and then convert to an array afterwards. But if you know your array size, you can preallocate memory and

Re: [Numpy-discussion] array not appending

2008-12-18 Thread David Cournapeau
Sebastian Haase wrote: On Thu, Dec 18, 2008 at 11:44 AM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Prashant Saxena wrote: ST = np.empty((), dtype=np.float32) ST = np.append(ST, 10.0) This works, is it proper way to do so? One more prob ST.size returns 2. Why? I

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Ravi
On Thursday 18 December 2008 08:00:09 Sebastian Haase wrote: So the question remains: how to create an array of empty (i.e. 0) size ? In [1]: from numpy import * In [2]: x = array( [] ) In [3]: x Out[3]: array([], dtype=float64) In [4]: x.size Out[4]: 0 In [5]: x.shape Out[5]: (0,) In [6]:

Re: [Numpy-discussion] immutable numpy arrays

2008-12-18 Thread Geoffrey Irving
On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Dec 17, 2008 at 17:45, Geoffrey Irving irv...@naml.us wrote: On Wed, Dec 17, 2008 at 3:34 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Dec 17, 2008 at 16:51, Geoffrey Irving irv...@naml.us wrote: On Wed,

Re: [Numpy-discussion] Recent umath changes

2008-12-18 Thread Charles R Harris
Hi David, On Wed, Dec 17, 2008 at 8:58 PM, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: Charles R Harris wrote: The declarations were for the SPARC. Originally I had them up in an ifdef up top, but I got curious what different machines would do. I still don't understand what

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Robert Kern
On Thu, Dec 18, 2008 at 07:58, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote: What would be the need for a 0 item array ? If the point is to append some data without knowing in advance the size, a list is most likely more adapted to the task. An array which cannot be indexed does not

Re: [Numpy-discussion] immutable numpy arrays

2008-12-18 Thread Robert Kern
On Thu, Dec 18, 2008 at 10:01, Geoffrey Irving irv...@naml.us wrote: On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern robert.k...@gmail.com wrote: It just seems to me to be another complication that does not provide any guarantees. You say Currently numpy arrays are either writable or unwritable,

[Numpy-discussion] new incremental statistics project

2008-12-18 Thread Bradford Cross
This is a new project I just released. I know it is C#, but some of the design and idioms would be nice in numpy/scipy for working with discrete event simulators, time series, and event stream processing. http://code.google.com/p/incremental-statistics/

Re: [Numpy-discussion] Recent umath changes

2008-12-18 Thread David Cournapeau
Hi Chuck, On Fri, Dec 19, 2008 at 2:15 AM, Charles R Harris charlesr.har...@gmail.com wrote: The undefs need to be there when the functions are defined by numpy, so they only need to be in the same #if block as those definitions. I moved them out to cover the function declarations also, but