Hi pytablers,

Before I am going to embark on using pytables2, I would like to know how
free I am in choosing the dtype of a column.
I would like to store a momentum in my table.
Currently in pytables1 I am using something like
momentum    = Float32Col(shape=3)

But now that I know more about numpy, I am wondering if there is a way to
specify the dtype of momentum, like so
momentum    = Float32Col(dtype={'names': ('x','y', 'z'), 'formats': (
N.float32, N.float32, N.float32)})
or something like that.
The other way would be to have momentum a class with three components x, y,
z.
That would be OK, too, but then will I be able to assign the values to the
row all at once?
Something like
row = table.row
row['momentum'] = (1, 2, 3)

Right now I am assigning a new dtype after reading the column, but if feels
like a hack and I would like to be able to read the right dtype from disk.

Thanks a lot,

   Jan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to