Re: [Numpy-discussion] Alternative to record array

2008-12-30 Thread Francesc Alted
A Tuesday 30 December 2008, Francesc Alted escrigué: > A Monday 29 December 2008, Jean-Baptiste Rudant escrigué: [snip] > > The difference for both approaches is that the row-wise arrangement > is more efficient when data is iterated by field, while the > column-wise one is more efficient when data

Re: [Numpy-discussion] Alternative to record array

2008-12-29 Thread Francesc Alted
A Monday 29 December 2008, Jean-Baptiste Rudant escrigué: > Hello, > > I like to use record arrays to access fields by their name, and > because they are esay to use with pytables. But I think it's not very > effiicient for what I have to do. Maybe I'm misunderstanding > something. > > Example : >

Re: [Numpy-discussion] Alternative to record array

2008-12-29 Thread Pierre GM
Jean-Baptiste, As you stated, everything depends on what you want to do. If you need to keep the correspondence age<>weight for each entry, then yes, record arrays, or at least flexible-type arrays, are the best. (The difference between a recarray and a flexible-type array is that fields can

Re: [Numpy-discussion] Alternative to record array

2008-12-29 Thread Ryan May
Jean-Baptiste Rudant wrote: > Hello, > > I like to use record arrays to access fields by their name, and because > they are esay to use with pytables. But I think it's not very effiicient > for what I have to do. Maybe I'm misunderstanding something. > > Example : > > import numpy as np > age =

Re: [Numpy-discussion] Alternative to record array

2008-12-29 Thread Jim Vickroy
Jean-Baptiste Rudant wrote: Hello, I like to use record arrays to access fields by their name, and because they are esay to use with pytables. But I think it's not very effiicient for what I have to do. Maybe I'm misunderstanding something. Example : import numpy as np age = np.random.ran

[Numpy-discussion] Alternative to record array

2008-12-29 Thread Jean-Baptiste Rudant
Hello, I like to use record arrays to access fields by their name, and because they are esay to use with pytables. But I think it's not very effiicient for what I have to do. Maybe I'm misunderstanding something. Example : import numpy as np age = np.random.randint(0, 99, 10e6) weight = np.ra