David Wallis
David Wallis

Reputation: 562

out-of-core 'where' on pytables array

I have a big pytables carray mapped to an hdf5 file and I want to extract a very small subset based on a condition without having to pull the whole thing into memory at once. All I want is the equivalent of this numpy code:

b=a[np.where(a>3.0)]

where 'a' would be my pytables disk array. It seems trivial but I've been scratching my head for hours. I'd be very grateful if anyone can help.

David

Upvotes: 2

Views: 151

Answers (1)

Francesc
Francesc

Reputation: 376

You cannot do 'out-of-core' queries for *Array objects in PyTables. The reason is that Table objects are the ones that received the largest share of love in PyTables. Your best bet here would be to store the CArray contents in a Table with just a column.

Upvotes: 3

Related Questions