I want to save a large number of fixed length string data in hdf5. Here is the code.
However, there is error message: TypeError: No conversion path for dtype: dtype('<U1')
Could you help to fix the reason? Thanks.
import numpy as np
import h5py
sdata = [ np.array(["A", "C", "A", "T", "C", "C", "T", "C"]), np.array(["G", "A", "C", "C", "C", "T", "A", "A"]), np.array(["G", "G", "A", "C", "C", "A", "A", "G"]) ]
sdata = np.array(sdata)
h5File = "test.h5"
with h5py.File(h5File, 'w') as h5data:
h5data.create_dataset('sequence', data=sdata, compression="lzf", chunks=True, maxshape=(None,sdata.shape[1]))
#