Re: [Numpy-discussion] recarray.__setattr__ bug?

2006-10-28 Thread Pierre GM
On Saturday 28 October 2006 22:45, Michael McNeil Forbes wrote: > Since the field names can be used with regular arrays without any > consequences, I think it would be bad to raise an exception with > recarrays where there was no problem with regular arrays, and regular > arrays should allow field

Re: [Numpy-discussion] pyaudio, a module to make noise from numpy arrays

2006-10-28 Thread David Cournapeau
Christopher Barker wrote: > > Does this have anything to do with this pyaudio? > > http://people.csail.mit.edu/hubert/pyaudio/ > > -Chris > Not at all. I should have looked for pyaudio as a name on google :) Before coding my small package, I looked at other python bindings for audio, but eith

Re: [Numpy-discussion] recarray.__setattr__ bug?

2006-10-28 Thread Michael McNeil Forbes
In article <[EMAIL PROTECTED]>, Pierre GM <[EMAIL PROTECTED]> wrote: > So that I could have a field named 'shape', and modifying > r.shape would change the shape of the array, not the content of the field ? > > That makes sense, but isn't it a bit dangerous ? Shouldn't we have a list of > reser

Re: [Numpy-discussion] recarray.__setattr__ bug?

2006-10-28 Thread Michael McNeil Forbes
In article <[EMAIL PROTECTED]>, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Hmm I know that the code was changed at some point a few months ago > specifically to this behavior because of some concerns Perry, Chris > (people at STScI) had. Originally, field names came first, but we > chan

Re: [Numpy-discussion] A recarray of arrays

2006-10-28 Thread Travis Oliphant
Pierre GM wrote: > Folks, > What is the easiest way to define a recarray of arrays ? > For example, I'd need something like that: > Given three arrays > x = N.arange(5) y = x+1 z = N.sqrt(x) > and a list of names: > n = ['x','y','z'] > Define a

[Numpy-discussion] A recarray of arrays

2006-10-28 Thread Pierre GM
Folks, What is the easiest way to define a recarray of arrays ? For example, I'd need something like that: Given three arrays >>> x = N.arange(5) >>> y = x+1 >>> z = N.sqrt(x) and a list of names: >>> n = ['x','y','z'] Define a 3-record array with two fields: the first one being a ndarray (in x, y

Re: [Numpy-discussion] recarray.__setattr__ bug?

2006-10-28 Thread Pierre GM
On Saturday 28 October 2006 14:28, Travis Oliphant wrote: > > Hmm I know that the code was changed at some point a few months ago > specifically to this behavior because of some concerns Perry, Chris > (people at STScI) had. Originally, field names came first, but we > changed it so they coul

[Numpy-discussion] Seal Campaign aquatic life.We

2006-10-28 Thread life.We an
Hints avoid common would like help of distribute of fliers club meetings events feel download in current flier.Bottom Balticon Wyndham downtown Baltimore in main hallway across entrance in first Here some advice which provides or useful hints avoid common would.Hints avoid common would like

Re: [Numpy-discussion] recarray.__setattr__ bug?

2006-10-28 Thread Travis Oliphant
Michael McNeil Forbes wrote: > Is the following the desired behaviour for setting recarray attributes? > This seems to clash with the semantics for arrays. > > >>> from numpy import * > >>> a = array([1,2,3]) > >>> b = a.view([('x',int),('y',int),('z',int)]) > >>> r = b.view(recarray) > >>>

Re: [Numpy-discussion] recarray.__setattr__ bug?

2006-10-28 Thread Pierre GM
On Friday 27 October 2006 22:18, Michael McNeil Forbes wrote: > Is the following the desired behaviour for setting recarray attributes?  I ran into the same problem recently... What about modifying __setattr__ to the following ? def __setattr__(self, attr, val): fielddict = sb.ndarra

Re: [Numpy-discussion] adding an attribute to an nd-array

2006-10-28 Thread Pierre GM
On Friday 27 October 2006 18:37, Albert Strasheim wrote: > Hello all ... > I would like to create an "info" array like this to attach some metadata, > mostly sampling frequency, to some of my arrays. > ... > I browsed through the NumPy book and looked at the __new__ and > __array_finalize__ stuff i