[Nipy-devel] good format for storing numeric data

Gael Varoquaux gael.varoquaux@normalesup....
Thu Nov 26 00:20:59 CST 2009


On Wed, Nov 25, 2009 at 09:56:35PM -0500, Satrajit Ghosh wrote:
> part 1. a quick update on the hdf5 and h5py stuff.

> installation:
> - on 64-bit snow leopard it took me a little work to get it installed
> (this will need to be streamlined a fair bit - hopefully its only a
> newness of SL thing)
> - on ubuntu this was relatively painless
> - haven't tried it on windows

To make install painless, you also have a pure Python reader:
http://h5py.alfven.org/

> usage:
> - with numpy stuff this was very easy
> - however if a recarray is stored in an hdf5 file, i could not figure
> out an easy way of determining that the loaded value is a recarray

What library are you using for IO.

> >> a = dict(foo='zoo',goo=np.ones((10,10)))
> >> something.save('myfile',a)
> >> b = something.load('myfile')
> >> b['foo'] == 'zoo'
> True

> np.savez/load and scipy.io.savemat/loadmat doesn't support the identity mapping.

Actually, with np.load, you will have to do:

b = np.load('myfile).flat[0]

and this will work. Yes, it is a bit screwed up.

Gaël



More information about the Nipy-devel mailing list