AttributeError: 'DataFrame' 对象没有属性 'items'pandas DataFrame 错误

问题描述

我用循环中的数据创建了一个 Pandas DataFrame(数据保存为 here)。现在,我想遍历这个 DataFrame。但是,当我尝试像这样访问 items() 函数时:

frame = pandas.read_csv(data_path + '/file1.csv')
frame.items()

我收到此错误:

Traceback (most recent call last):
  File "<input>",line 1,in <module>
  File "C:\Python27\ArcGIS10.7\lib\site-packages\pandas\core\generic.py",line 2668,in __getattr__
    return object.__getattribute__(self,name)
AttributeError: 'DataFrame' object has no attribute 'items'

这特别奇怪,因为 PyCharm 为我提供了填写 items 的选项,如果我只输入 frame.it
这是什么意思?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...