Reading a PICKLE file

Pickling is a way to convert a Python object of any type, including a list, dictionary, and so on, into a character string. The idea is that this character string contains all the information necessary for reconstructing the object in another Python script.

We use read_pickle method to read our PICKLE file, as shown in the following code. As with other data formats, pandas creates a DataFrame  from the read data:

df = pd.read_pickle('IMDB.p')df.head()

The output is as follows:

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.