Skip to content

Instantly share code, notes, and snippets.

@moble
Last active December 16, 2015 06:28
Show Gist options
  • Save moble/5391305 to your computer and use it in GitHub Desktop.
Save moble/5391305 to your computer and use it in GitHub Desktop.
Add '.dir' to the end of every group in the root of an h5 file
#! /usr/bin/env python
import sys
import h5py
for filename in sys.argv[1:] :
with h5py.File(filename, 'r+') as f :
for group in list(f) :
f[group+'.dir'] = f[group]
del(f[group])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment