在Google-Colab pandas.read_pickle()
我使用 pd.to_pickle() 从我的计算机制作了一个数据帧的 pickle 文件,但我无法在 colab 中读取该文件。它给出错误ValueError:不支持的pickle协议:5
。请给出解决方案。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要首先安装
pickle5
,使用:然后,
You need to install
pickle5
first, using:Then,
我在尝试打开“pickled”pd.dataframe 时遇到了类似的问题。对我来说,解决方案是升级 google colab 笔记本的默认 pandas 版本。从 1.3.5 到 1.5.2
点!安装pandas==1.5.2
重启内核
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
restart kernel