我想把一个可变长度的字符串列表存储到HDF5数据集中。代码如下:
import h5py
h5File=h5py.File('xxx.h5','w')
strList=['asas','asas','asas']
h5File.create_dataset('xxx',(len(strList),1),'S10',strList)
h5File.flush()
h5File.Close()
我遇到了一个错误,提示"TypeError: No conversion path for dtype: dtype('< U3')",其中<代表实际的小于号。如何解决这个问题。
create_dataset
上有一个拼写错误。您能否提供您正在使用的确切代码,特别是strList
来自哪里? - SlightlyCuban