A Sunday 30 January 2011 08:20:01 Tom Fawcett escrigué:
> Hi.  I recently discovered pytables, and I’m impressed with its speed
> and flexibility.  But there’s one feature I’d like and I can’t
> figure out how whether pytables can do it.
> 
> I’d like to have essentially a set-valued column in a table.  I’d
> like a column data type that is very similar to a Python set.  I’m
> not sure how to achieve this naturally with pytables – it looks like
> none of the Cols subclasses can be variable length.  Any ideas?

Yup.  Table objects do not support variable length columns.  The reason 
for this is that you need fixed size in order to anticipate I/O buffer 
sizes for accelerating the I/O.

What normally people do is to put variable length stuff into VLArray 
objects:

http://www.pytables.org/docs/manual/ch04.html#VLArrayClassDescr

and reference the entries there from the table by using a column for 
keeping the indices.  VLArray does support a pseudo-atom called 
ObjectAtom() that can serialize any Python object (uses pickle behind 
the scenes), that might be handy for your needs.

Cheers,

-- 
Francesc Alted

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to