Skip to content

Instantly share code, notes, and snippets.

@themperek
Last active May 24, 2016 09:15
Show Gist options
  • Save themperek/6c0067782fffe5c6ced8e47e08375ba3 to your computer and use it in GitHub Desktop.
Save themperek/6c0067782fffe5c6ced8e47e08375ba3 to your computer and use it in GitHub Desktop.
filter_tables = tables.Filters(complib='blosc', complevel=0)
def hser(data):
h5file = tables.open_file("in-memory", "w", driver="H5FD_CORE", driver_core_backing_store=0)
h5file.create_table(h5file.root, "array", data, filters=filter_tables)
fi = h5file.get_file_image()
h5file.close()
return fi
def hdes(sdata):
h5_file = tables.open_file("in-memory", mode="r", driver="H5FD_CORE", driver_core_image=sdata, driver_core_backing_store=0)
sdatax = h5_file.root.array[:]
h5_file.close()
return sdatax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment