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 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 if those are put in thei

[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] immutable numpy arrays

2008-12-18 Thread Robert Kern
On Thu, Dec 18, 2008 at 10:01, Geoffrey Irving wrote: > On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern 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, but unwritable arrays can s

Re: [Numpy-discussion] array not appending

2008-12-18 Thread Robert Kern
On Thu, Dec 18, 2008 at 07:58, David Cournapeau 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 > sound that useful, but I ma

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 understa

Re: [Numpy-discussion] immutable numpy arrays

2008-12-18 Thread Geoffrey Irving
On Wed, Dec 17, 2008 at 4:28 PM, Robert Kern wrote: > On Wed, Dec 17, 2008 at 17:45, Geoffrey Irving wrote: >> On Wed, Dec 17, 2008 at 3:34 PM, Robert Kern wrote: >>> On Wed, Dec 17, 2008 at 16:51, Geoffrey Irving wrote: On Wed, Dec 17, 2008 at 2:24 PM, Robert Kern wrote: > On Wed, De

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] array not appending

2008-12-18 Thread David Cournapeau
Sebastian Haase wrote: > On Thu, Dec 18, 2008 at 11:44 AM, David Cournapeau > 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. >>> >>> W

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 Sebastian Haase
On Thu, Dec 18, 2008 at 11:44 AM, David Cournapeau 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 added

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

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 To: Discussion of Numerical Python Sent: Thursday, 18 D

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
How do I solve this? Thanks Prashant From: Gael Varoquaux To: Discussion of Numerical Python 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: >

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]

[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]: prin

[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 an