[Please, remember to always respond to the list, as your feedback can be 
important for other users]

A Friday 15 May 2009 10:46:07 David Fokkema escrigué:
> > Now, let's imagine that the row references are kept in the 'traces' field
> > of your table 't'.  Then, you can do things like:
> >
> > In [54]: [vla[r['traces']] for r in t.where('(nanoseconds < 3) &
> > (timestamp > 3200000')]
> > Out[54]:
> > [array([5, 6, 9, 8], dtype=int32),
> >  array([5, 6], dtype=int32),
> >  array([1, 2, 4], dtype=int32)]
> >
> > That's a very simple example, but I hope you've got the idea.
>
> I do, thank you very much! I read up on the various array options and I
> now realize it _is_ mentioned in the documentation, but I missed it. In
> the tutorial, only regular arrays are covered and those are created from
> an in-memory object.

Yeah, despite the fact that the tutorial is pretty large already, there is a 
lot of features of PyTables that are not covered there, so you need to check 
the reference chapter where *everything* meant for public consumption should 
be listed.  The examples/ directory that comes with the source distribution 
can also be a source of inspiration.  But I agree that this is one of the 
cases where a CookBook page or a PyTablesByExample page in the MoinMoin site 
would be interesting.  Someone volunteers to start one?

> So, it's only some sort of array persistence. I
> totally missed the fact that EArray's and VLArray's are actually a lot
> more table-like. Slicing makes sure you don't need to load the entire
> array in memory. I like it, thanks!
>
> That said, is it possible (in a future version) to have an ArrayCol-like
> object?

Uh, you mean tables with variable length fields?  No, I don't think this is 
going to happen (unless a different kind of table would be implemented).  The 
reason is that most of the performance in PyTables comes from the fact that 
you deal with fixed-length data types.  If you need variable length types, my 
recommendation is to keep them separately in VLArray objects and store 
references to them in Table or other *Array objects, as I suggested above.

Cheers,

-- 
Francesc Alted

"One would expect people to feel threatened by the 'giant
brains or machines that think'.  In fact, the frightening
computer becomes less frightening if it is used only to
simulate a familiar noncomputer."

-- Edsger W. Dykstra


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to