Guest User

Untitled

a guest
Jan 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import h5py
  2. for iteration in range(100):
  3. with h5py.File('results.h5','a') as f:
  4. path = '/state/iteration%d' % iteration
  5. state = get_state(iteration)
  6. f.create_dataset(path, data=state)
  7.  
  8. import h5py
  9. for iteration in range(100):
  10. file_path = 'results_iteration%d.h5' % iteration
  11. path = '/state/iteration%d' % iteration
  12. state = get_state(iteration)
  13. with h5py.File(file_path,'w') as f:
  14. f.create_dataset(path, data=state)
Add Comment
Please, Sign In to add comment