Why use read_pickle method in C3_W1_Assignment Section 2.1: Generating the Dataset

What is this method? What type is .pkl file (guess it stands for pickle)? Why is it any better than regular csv or excel? Thank you.

A pickle file effectively preserves the integrity of your object, ensuring that no data is lost during storage. Whether it’s a dataframe or a model, when you retrieve it from a pickle file, it remains entirely intact. This is what makes it superior to other methods, such as saving a dataframe as a CSV, where you might not retain the precise dataframe structure.


Pickling is capable of a lot more (and using more complex configurations) than a flat 2D CSV file or spreadsheet. Excel formats are proprietary, so Python tends to avoid it.