我编写了这段代码来将数据集加载到数据框中。数据集在 pickle 文件中给出,但会引发错误:
ModuleNotFoundError:没有名为“pandas.core.indexes”的模块
import pickle
import pandas
dbfile = open(dataset loction,'rb')
df = pickle.load(dbfile)
我尝试了所有给出的修复:
- 更新了熊猫
- 使用
df = pandas.read_picle(dataset location)
尝试使用 pip 安装 pickle 但出现此错误
C:\installs\WinPython-64bit-3.6.1.0Qt5\python-3.6.1.amd64>python -m pip install pickle
Collecting pickle
Could not find a version that satisfies the requirement pickle (from versions: )
No matching distribution found for pickle
原文由 RAMAN BHATIA 发布,翻译遵循 CC BY-SA 4.0 许可协议
听起来 pickle 文件是用不同版本的 Pandas 创建的,而您当前安装的 Pandas 没有 pickle 中的某些数据所需的
pandas.core.indexes
模块。您使用的是哪个版本的 Pandas?你试过升级吗?
编辑:Pandas 0.19.2 没有那个模块: