标签: python h5py
我想获取h5文件的根组对象并为其添加属性,而不是像我现在所拥有的那样创建一个新的子组:
f = h5py.File("test.h5", "w") grp = f.create_group("group1") grp.attrs['att'] = 0
答案 0 :(得分:1)
h5py.File is its own root group,所以:
h5py.File
f.attrs['att'] = 0