If have a problem storing np.arrays but i was not able to fix it by now. Maybe someone has an idea.
a = np.arange(-180,181)
b = np.arange(-82,83)
grid = [ [ np.zeros((0), dtype=float32) for i in range(len(b)) ] for j in range(len(a)) ]so for grid[0][0] I might have np.array((1,2.3,2.5, dtype=float32) and if I try to export it to an hdf5 file via
f = h5py.File('test.hdf5','w')
f.create_dataset('grid', data=grid)I receive:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\...\python-2.7.3.amd64\lib\site-packages\h5py\_hl\group.py", line 71, in create_dataset
dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
File "C:\...\python-2.7.3.amd64\lib\site-packages\h5py\_hl\dataset.py", line 89, in make_new_dset
tid = h5t.py_create(dtype, logical=1)
File "h5t.pyx", line 1361, in h5py.h5t.py_create (h5py\h5t.c:12530)
File "h5t.pyx", line 1433, in h5py.h5t.py_create (h5py\h5t.c:12380)
TypeError: Object dtype dtype('object') has no native HDF5 equivalentI tried to change the np.array to a list so that:
grid = [ [ [] for i in range(len(b)) ] for j in range(len(a)) ]
grid[0][0] = [1,2.3,2.5]--
You received this message because you are subscribed to a topic in the Google Groups "h5py" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h5py/2htGgZ2EHPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h5py+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.