Reputation: 24131
After saving a Pandas DataFrame with df.to_pickle(file_name)
, it can be loaded with df = pd.read_pickle(file_name)
. But sometimes, you may only want to load the data for one Series at a particular time, and loading the entire DataFrame is inefficient. Is there a way to load just a single Series from a pickled DataFrame?
Upvotes: 1
Views: 394
Reputation: 305
This is not possible because pickle files are serialized and reading a single column of a serialized file is not possible. You can read a single column of other file types (i.e. h5, csv, etc.) but not a serialized file.
Upvotes: 2