Skip to content

Instantly share code, notes, and snippets.

@shgidi
Created May 7, 2017 10:19
Show Gist options
  • Save shgidi/047dedc48136e479354c12a4a1377754 to your computer and use it in GitHub Desktop.
Save shgidi/047dedc48136e479354c12a4a1377754 to your computer and use it in GitHub Desktop.
import bcolz
import pickle
def save_array(fname, arr):
c=bcolz.carray(arr, rootdir=fname, mode='w')
c.flush()
def load_array(fname):
return bcolz.open(fname)[:]
def save_pickle(fname, obj):
with open(fname, "wb") as output_file:
pickle.dump(obj, output_file)
def load_pickle(fname):
with open(fname, "rb") as input_file:
return pickle.load(input_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment