Created
May 7, 2017 10:19
-
-
Save shgidi/047dedc48136e479354c12a4a1377754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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