You now know how to use the Python pickle
module to convert an object hierarchy to a stream of bytes that can be saved to a disk or transmitted over a network. You also know that the deserialization process in Python must be used with care since unpickling something that comes from an untrusted source can be extremely dangerous.
In this course, you’ve learned:
- What it means to serialize and deserialize an object
- Which modules you can use to serialize objects in Python
- Which kinds of objects can be serialized with the Python
pickle
module - How to use the Python
pickle
module to serialize object hierarchies - What the risks are of unpickling from an untrusted source
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
Jon Nyquist on Dec. 24, 2020
I read an article on Medium suggesting breaking long Jupyter notebooks into smaller concerns with pickle to pass pandas dataframes between the notebooks.
df.to_pickle(PROCESSED_FILE)
Seems like an interesting idea.