deerlab.store_pickle

store_pickle(obj, filename)[source]

Save/export an object to a .pkl file serialized as bytes.

Parameters:
objobject

Python object to be saved/exported.

filenamestring

Name (and path) of the file to save the pickled object to. The object is saved as a .pkl file. If filename does not end in “.pkl”, the extension is added automatically.

Examples

store_pickle(my_object, ‘my_file.pkl’) store_pickle(my_object, ‘./data/my_file’) # equivalent to ‘./data/my_file.pkl’