From: Francesc A. <fa...@py...> - 2004-10-19 09:35:34
|
A Dilluns 18 Octubre 2004 15:19, Norbert Nemec va escriure: > maybe I'm just blind trying to read the docs: Is there any way to write to an > existing array within a h5file? I would have expected the following to work, > but it does not: > --------------------------- > from tables import * > from scipy import * > h5 = openFile("tryout.h5",'a') > h5.createArray(h5.root,"tryarray",zeros((3,4))) > h5.root.tryarray[2,2] = 17. > --------------------------- > but the last line gives "TypeError: object does not support item assignment" > > What would be the correct approach? That would be the correct approach if modification of values in Arrays would be supported, but it is not. However, I've implemented value modification in Table objects for forthcoming PyTables 0.9 (you can fetch the RC1 in http://pytables.sourceforge.net/pytables-0.9-rc1.tar.gz). Maybe you can use use it until I (or somebody else) find time to implement value modification in *Arrays as well. Regards, -- Francesc Alted |