[Pytables-users] Question about reading a complete table.

2012-02-20 Thread German Ocampo
Good morning Im new in Pytables and I have a simple question, please help me. I have a pytable created with four Float() columns, the number of rows in the table is around 500.000. I need to read all the complete table in fastest way possible to a numpy array in memory. Im using the following

Re: [Pytables-users] Question about reading a complete table.

2012-02-20 Thread Anthony Scopatz
Hello German, The easiest and probably the fastest way is to use numpy array. Simply pass the table into the array constructor: import numpy as np a = np.array(f.root.path.to.table) If your table contains more than one type and you want to keep that setup via a structured array, also pass in

Re: [Pytables-users] Question about reading a complete table.

2012-02-20 Thread Ümit Seren
I guess using the slice operator on the table should probably also load the entire table into memory: a = f.root.path.to.table[:] This will return a structured array tough. On Mon, Feb 20, 2012 at 5:43 PM, Anthony Scopatz scop...@gmail.com wrote: Hello German, The easiest and probably the

Re: [Pytables-users] Question about reading a complete table.

2012-02-20 Thread Francesc Alted
On Feb 20, 2012, at 6:15 PM, Ümit Seren wrote: I guess using the slice operator on the table should probably also load the entire table into memory: a = f.root.path.to.table[:] Much, much better :) This will return a structured array tough. Yes, but nothing that cannot be solved: a =