最好先安装numpy,看我上一个教程
sudo apt-get install libhdf5-dev
git clone https://github.com/h5py/h5py
cd h5py
sudo python setup.py install
和numpy配合使用:
import numpy as np
import h5py
sampledata=np.zeros(int(sample_count))
f=h5py.File(filename,"w")
f.create_dataset('sampledata',data=sampledata)
f.close()