Skip to content

Instantly share code, notes, and snippets.

@mp4096
Created July 10, 2017 10:20
Show Gist options
  • Save mp4096/e9e69a0db0c95b859cf2f471e4bc910d to your computer and use it in GitHub Desktop.
Save mp4096/e9e69a0db0c95b859cf2f471e4bc910d to your computer and use it in GitHub Desktop.
Store and load Python objects
import joblib
a = 1
b = "hello"
c = 2.71828
# The `compress` argument is optional;
# 9 is the highest compression level
joblib.dump((a, b, c), "foo.xz", compress=9)
print(joblib.load("foo.xz"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment