I'm writing some utility code that needs to search through some 
presorted HDF5 Arrays to find values.  The fastest way to search is with 
the numpy.ndarray.searchsorted method.  The problem is that some of our 
data was written with Pytables from a list, so calling read on the Array 
returns a python list, as per the flavor, so I need to convert it to a 
numpy.array.

        If I can read the array as if it had a numpy flavor, that would save me 
a step to determine if a conversion is needed, and the conversion time.

        Is there a way to force PyTables to read a dataset as a different 
flavor than it was saved as?

        Looking at the definition of the Array.read method, it already does a 
conversion from the internal flavor (which is numpy in our case) to the 
final flavor.  I just need it to not convert from internal to the 
array's flavor.  My current workaround is to just use the first two 
lines of the three-line method:

array._read(*array._processRangeRead(None,None,None))

But I'd rather use a method in the official API.

-- 
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to