def add_text_h5(fid, path, data):
"""Add text data (UTF-8) to the given path in the HDF5 file
with handle fid.
Arguments:
- fid is the file handle to the HDF5 file
- path is the base path inside the HDF5 file
- data is the text data as a string
"""
dset = fid.create_dataset(name=path,
shape=(1,),
dtype=h5py.special_dtype(vlen=str),
data=data,
compression="gzip")
评论列表
文章目录