Reputation: 91
I made a pickle file of a dataframe from my computer using pd.to_pickle()
which I could not read in colab. It gives error ValueError: unsupported pickle protocol: 5
. Please give a solution.
Upvotes: 0
Views: 1464
Reputation: 1
I was in a similar problem trying to open a "pickled" pd.dataframe. The solution for me was upgrade the default pandas version of google colab notebook. From 1.3.5 to 1.5.2
pip! install pandas==1.5.2
Upvotes: 0
Reputation: 489
You need to install pickle5
first, using:
!pip install pickle5
Then,
#Import the library
import pickle5 as pickle
path = 'path_to_pickle5'
with open(path, "rb") as dt:
df = pickle.load(dt)
Upvotes: 1