txt2hdf5.py 234 B

123456789101112
  1. #!/usr/bin/python
  2. from __future__ import print_function
  3. import numpy as np
  4. import h5py
  5. import sys
  6. data = np.loadtxt(sys.argv[1], dtype='float32')
  7. h5f = h5py.File(sys.argv[2], 'w');
  8. h5f.create_dataset('data', data=data)
  9. h5f.close()