Re: [Numpy-discussion] PyTables, array and recarray

2008-06-02 Thread Pierre GM
On Monday 02 June 2008 08:03:15 Hanno Klemm wrote: > thanks for your replies, the view works fine. The reason why I like > recarrays is that you can address your fields simply with a.Name, when > a is your array. I find that highly convenient when working with data > interactively. > > As far as I

Re: [Numpy-discussion] PyTables, array and recarray

2008-06-02 Thread Hanno Klemm
Francesc, Pierre, thanks for your replies, the view works fine. The reason why I like recarrays is that you can address your fields simply with a.Name, when a is your array. I find that highly convenient when working with data interactively. As far as I know there is no similar possbility to do

Re: [Numpy-discussion] PyTables, array and recarray

2008-05-30 Thread Francesc Alted
A Friday 30 May 2008, Hanno Klemm escrigué: > Hi, > > I try to save the contents of a numpy recarray with PyTables into a > file. That works well, however, if I then try to retrieve the data, I > get back an array with matching dtypes rather than a recarray. > > What is the best way to get a recarr

Re: [Numpy-discussion] PyTables, array and recarray

2008-05-30 Thread Pierre GM
On Friday 30 May 2008 11:17:18 Hanno Klemm wrote: Hanno, Try a view: > >>> f.close() > >>> f = t.openFile('test.h5', 'r') > >>> b = f.root.test[:].view(N.recarray) Views are often the most efficient way to change the type of an array. ___ Numpy-discussio

[Numpy-discussion] PyTables, array and recarray

2008-05-30 Thread Hanno Klemm
Hi, I try to save the contents of a numpy recarray with PyTables into a file. That works well, however, if I then try to retrieve the data, I get back an array with matching dtypes rather than a recarray. What is the best way to get a recarray back, or if that's not possible what's the most effi