Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Serializing Objects With the Python pickle Module (Summary)

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
Download

Sample Code (.zip)

5.4 KB
Download

Course Slides (.pdf)

213.2 KB
Avatar image for Jon Nyquist

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.

Become a Member to join the conversation.