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 = f.root.path.to.table[:].view(np.float32).reshape(-1, 4)

Quick explanation:

* Operator [:] reads out all the table and creates and structured array
* Method `view(np.float32)` makes the data look like homogeneous float array
* Method `reshape(-1, 4)` returns an homogeneous array with 4 columns.

This does not require an additional data copy to obtain the homogeneous array.

-- Francesc Alted







------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to