Created
May 29, 2018 17:20
-
-
Save RobBlackwell/05568a2f057304e769df8166a1d135d8 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
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