Skip to content Skip to sidebar Skip to footer

In H5py, What Is Type "|o"?

Debugging a program working with h5py. The hdf5 should look something like this: test.hdf5 -labels <- DataSet -train <- Group I do: >>> import h5py >>

Solution 1:

It's a reference.

implementing the example in that section:

In [275]: import h5py
In [276]: ref_dtype = h5py.special_dtype(ref=h5py.Reference)
In [278]: ref_dtype
Out[278]: dtype('O')

In [279]: f=h5py.File('test.h5','w')
In [281]: ref_dataset = f.create_dataset("MyRefs", (100,), dtype=ref_dtype)
In [282]: ref_dataset
Out[282]: <HDF5 dataset "MyRefs": shape (100,), type "|O">
In [283]: ref_dataset[:].dtype
Out[283]: dtype('O')

Post a Comment for "In H5py, What Is Type "|o"?"