【发布时间】:2017-09-09 12:00:30
【问题描述】:
我有 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。
【问题讨论】: