我有如下的 hdf5 数组:
>>> a = np.array([5,8])
>>> f = h5py.File('try.hdf5')
>>> f['try'] = a
>>> f['try']
<HDF5 dataset "try": shape (2,), type "<i4">
我想将 f['try'] 的数据类型更改为 float64。怎么做?
a = a.astype('float64')可以用于 numpy,但我不知道用于 hdf5。
请您参考如下方法:
