Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import h5py
  2.  
  3. f = h5py.File('./data/..../test.h5', 'w')
  4.  
  5. x = np.array([[][], [][]])
  6.  
  7. dt = h5py.special_dtype(vlen=str)
  8. d1 = f.create_dataset('d1', shape=x.shape, dtype=dt)
  9. d1[:] = x
  10.  
  11. f['test'].attrs['names'] = ['content', 'label']
  12.  
  13.  
  14. f = h5py.File('x......h5')
  15. test = f['test'][:]
  16. names = f['test'].attrs['names']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement