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

2006-10-29 Thread Travis Oliphant
Michael McNeil Forbes wrote: 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

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

2006-10-29 Thread Pierre GM
On Sunday 29 October 2006 02:40, Travis Oliphant wrote: I've committed some fixes to this particular issue that allows setattr to be used to set field names. I just started playing with the new recarray: that works great ! Travis, Thanks a lot !

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 =

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) b['x'] = 0 r.y = 0

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 could

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 changed it

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 reserved

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

[Numpy-discussion] recarray.__setattr__ bug?

2006-10-27 Thread Michael McNeil Forbes
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)   b['x'] = 0   r.y = 0   a  array([0, 2, 3])   r.x  

Re: [Numpy-discussion] recarray

2006-09-18 Thread Lionel Roubeyrie
Le vendredi 15 septembre 2006 16:05, Francesc Altet a écrit : Another possibility is to play with columns directly from the initial recarray. The next is an example: In [101]: ra=numpy.rec.array(1*36, dtype=a4,i4,f4, shape=3) In [102]: ra Out[102]: recarray([('', 825307441,

Re: [Numpy-discussion] recarray

2006-09-18 Thread Lionel Roubeyrie
Le lundi 18 septembre 2006 12:17, Francesc Altet a écrit : You have two problems here. The first is that you shouldn't have missign entries, or conversion from empty strings to ints (or whatever) will fail: int('') Traceback (most recent call last): File stdin, line 1, in ? ValueError:

Re: [Numpy-discussion] recarray

2006-09-18 Thread Francesc Altet
El dl 18 de 09 del 2006 a les 17:10 +0200, en/na Lionel Roubeyrie va escriure: Le lundi 18 septembre 2006 12:17, Francesc Altet a écrit : You have two problems here. The first is that you shouldn't have missign entries, or conversion from empty strings to ints (or whatever) will fail:

Re: [Numpy-discussion] recarray

2006-09-18 Thread Lionel Roubeyrie
Le lundi 18 septembre 2006 17:40, Francesc Altet a écrit : I'm running NumPy 1.0b5. Please, check that you are using a recent version of it. Cheers, Arg, sorry, version here was 0.9, an upgrade and it works fine. thanks again -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR

[Numpy-discussion] recarray

2006-09-15 Thread Lionel Roubeyrie
Hi all, I try to use recarray with rec.fromrecords on time-series, datas come from a file where they are stored in csv format, with after each data colum there is one column meanning the state of the data, and the first column is for dates. Then, is it possible to directly transform column of

Re: [Numpy-discussion] recarray

2006-09-15 Thread Robert Kern
Lionel Roubeyrie wrote: Hi all, I try to use recarray with rec.fromrecords on time-series, datas come from a file where they are stored in csv format, with after each data colum there is one column meanning the state of the data, and the first column is for dates. Then, is it possible to

Re: [Numpy-discussion] recarray

2006-09-15 Thread Francesc Altet
A Divendres 15 Setembre 2006 15:57, Robert Kern va escriure: Lionel Roubeyrie wrote: Hi all, I try to use recarray with rec.fromrecords on time-series, datas come from a file where they are stored in csv format, with after each data colum there is one column meanning the state of the

Re: [Numpy-discussion] recarray field names

2006-07-10 Thread John Parejko
Howdy! I just wanted to voice my agreement with this statment by Erin Sheldon: I brought up the issue a while back of having a simple way to access the field names of an array. The quick summary: accessing field names has some oddness that needs cleaning up. Sometimes a['name'], sometimes

Re: [Numpy-discussion] recarray field names

2006-07-10 Thread Travis Oliphant
John Parejko wrote: Howdy! I just wanted to voice my agreement with this statment by Erin Sheldon: I brought up the issue a while back of having a simple way to access the field names of an array. The quick summary: accessing field names has some oddness that needs cleaning up. Sometimes

Re: [Numpy-discussion] recarray field names

2006-07-10 Thread Travis Oliphant
John Parejko wrote: Howdy! I just wanted to voice my agreement with this statment by Erin Sheldon: I brought up the issue a while back of having a simple way to access the field names of an array. The quick summary: accessing field names has some oddness that needs cleaning up. Sometimes

Re: [Numpy-discussion] recarray field names

2006-07-10 Thread Erin Sheldon
Just tested the lastest SVN and it works as advertised. Thanks Travis. An unrelated question: why does this work for arrays but not recarrays? In [24]: mydescriptor = [('age',float64),('Nchildren',int8),('weight',float32)] In [25]: a = array([(64,2,75.0),(25,0,60.0)], dtype=mydescriptor)

Re: [Numpy-discussion] recarray field names

2006-07-10 Thread Travis Oliphant
Erin Sheldon wrote: Just tested the lastest SVN and it works as advertised. Thanks Travis. An unrelated question: why does this work for arrays but not recarrays? In [24]: mydescriptor = [('age',float64),('Nchildren',int8),('weight',float32)] In [25]: a =

Re: [Numpy-discussion] recarray field names

2006-07-10 Thread Erin Sheldon
On 7/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: Erin Sheldon wrote: Just tested the lastest SVN and it works as advertised. Thanks Travis. An unrelated question: why does this work for arrays but not recarrays? In [24]: mydescriptor =

[Numpy-discussion] recarray field names

2006-07-09 Thread Erin Sheldon
Hi everyone - (sigh) These gmail issues are really annoying...so I apologize if the gmail version of this message shows up in a few days. I brought up the issue a while back of having a simple way to access the field names of an array. The quick summary: accessing field names has some oddness

Re: [Numpy-discussion] recarray field names

2006-07-08 Thread Erin Sheldon
It was suggested that I put off this discussion until we were closer to the 1.0 release. Perhaps now is a good time to bring it up once again? The quick summary: accessing field names has some oddness that needs cleaning up. On 3/15/06, Travis Oliphant [EMAIL PROTECTED] wrote: Fernando Perez

[Numpy-discussion] Recarray attributes writeable

2006-06-17 Thread Erin Sheldon
Hi everyone - Recarrays have convenience attributes such that fields may be accessed through . in additioin to the field() method. These attributes are designed for read only; one cannot alter the data through them. Yet they are writeable: tr=numpy.recarray(10, formats='i4,f8,f8',

[Numpy-discussion] Recarray attributes writable

2006-06-17 Thread Erin Sheldon
Hi everyone - Recarrays have convenience attributes such that fields may be accessed through . in additioin to the field() method. These attributes are designed for read only; one cannot alter the data through them. Yet they are writeable: tr=numpy.recarray(10, formats='i4,f8,f8',

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-17 Thread Francesc Altet
El dv 16 de 06 del 2006 a les 14:46 -0700, en/na Andrew Straw va escriure: Erin Sheldon wrote: Anyway - Recarrays have convenience attributes such that fields may be accessed through . in additioin to the field() method. These attributes are designed for read only; one cannot alter the

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-17 Thread Fernando Perez
On 6/17/06, Francesc Altet [EMAIL PROTECTED] wrote: However, I think that this has its utility, specially when accessing to nested fields (see later). In addition, I'd suggest introducing a special accessor called, say, 'fields' in order to access the fields themselves and not the attributes.

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-17 Thread Erin Sheldon
This reply sent 9:36 AM, Jun 17 (because it may not show up for a day or so from my gmail account, if it shows up at all) On 6/17/06, Francesc Altet [EMAIL PROTECTED] wrote: El dv 16 de 06 del 2006 a les 14:46 -0700, en/na Andrew Straw va escriure: Erin Sheldon wrote: Anyway - Recarrays

[Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Erin Sheldon
Hi everyone - (this is my fourth try in the last 24 hours to post this. Apparently, the gmail smtp server is in the blacklist!! this is bad). Anyway - Recarrays have convenience attributes such that fields may be accessed through . in additioin to the field() method. These attributes are

[Numpy-discussion] Recarray attributes writeable (3rd try)

2006-06-16 Thread Erin Sheldon
Hi everyone - (this is my third try in the last 24 hours to post this. For some reason it hasn't been making it through) Recarrays have convenience attributes such that fields may be accessed through . in additioin to the field() method. These attributes are designed for read only; one cannot

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Robert Kern
Erin Sheldon wrote: Hi everyone - (this is my fourth try in the last 24 hours to post this. Apparently, the gmail smtp server is in the blacklist!! this is bad). I doubt it since that's where my email goes through. Sourceforge is frequently slow, so please have patience if your mail does

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Andrew Straw
Erin Sheldon wrote: Anyway - Recarrays have convenience attributes such that fields may be accessed through . in additioin to the field() method. These attributes are designed for read only; one cannot alter the data through them. Yet they are writeable: tr=numpy.recarray(10,

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-16 Thread Erin Sheldon
The initial bounces actually say, and I quote: Technical details of temporary failure: TEMP_FAILURE: SMTP Error (state 8): 550-rejected because your SMTP server, 66.249.92.170, is in the Spamcop RBL. 550 See http://www.spamcop.net/bl.shtml for more information. On 6/16/06, Robert Kern [EMAIL