Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import h5py
- for iteration in range(100):
- with h5py.File('results.h5','a') as f:
- path = '/state/iteration%d' % iteration
- state = get_state(iteration)
- f.create_dataset(path, data=state)
- import h5py
- for iteration in range(100):
- file_path = 'results_iteration%d.h5' % iteration
- path = '/state/iteration%d' % iteration
- state = get_state(iteration)
- with h5py.File(file_path,'w') as f:
- f.create_dataset(path, data=state)
Add Comment
Please, Sign In to add comment