Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using PyCall
@pyimport pickle
# This works for complex objects such as Scikit learn models. REB
# 20171129
function mypickle(filename, obj)
out = open(filename,"w")
pickle.dump(obj, out)
close(out)
end
function myunpickle(filename)
r = nothing
@pywith pybuiltin("open")(filename,"rb") as f begin
r = pickle.load(f)
end
return r
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment