本文介绍了重新安装后使用pandas数据框的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经重新安装了Python和Anaconda,现在面临以下问题。

I have reinstalled Python and Anaconda and now I face the following issue.

在将.pkl文件加载到数据框并尝试查看该文件后如下:

After I have loaded a .pkl file to a dataframe and tried to 'take a look' at the file as follows:

df = pd.read_pickle("example.pkl")
df

我得到一个错误:

AttributeError: 'DataFrame' object has no attribute '_data'

呼叫:

df.head()

提供:

RecursionError: maximum recursion depth exceeded while calling a Python object

时超出了最大递归深度,但是我试图超过该深度暗恋 Python已停止工作。不过,我不记得在以前的安装中更改过设置。

I have already tried to exceed the depth, but it led to a crush "Python has stopped working". I cannot remember changing the setting in the previous installation, though.

你们中的任何人是否知道可能的解决方案?
最好的问候!

Does anyone of you know the possible solution?Best regards!

编辑:我可能应该补充一点,该文件有大约5000万行(以前也不是问题)。

I probably should add that the file has ca 50M rows (which again has not been an issue previously).

推荐答案

我遇到了同样的问题,并通过将熊猫从1.1.0降级到1.0.3。暂时避免了它。

I encountered the same issue, and temporarily avoid it by downgrading pandas from 1.1.0 to 1.0.3.

pip uninstall pandas
pip install pandas==1.0.3

希望可以。

这篇关于重新安装后使用pandas数据框的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 16:56