Python中文
首页
教程
问答
标签
搜索
登录
注册
AttributeError:“DataFrame”对象没有属性“raw\u ratings”
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我在使用以下命令时出错</p> <pre><code>trainset, testset = train_test_split(t2data, test_size=.15,train_size=0.85) </code></pre> <p>数据集包含用户评级、用户ID和产品ID</p> <p>错误消息:</p> <pre><code>AttributeError: 'DataFrame' object has no attribute 'raw_ratings' </code></pre> <p>我的数据帧没有任何名为raw_ratings的属性</p> <p>以下是我阅读CSV的方式:</p> <pre><code>rdata = pd.read_csv('ratings_Electronics.csv', header=0, names ['userid','productid','rating','timestamp'],skipinitialspace=True) </code></pre> <p>所以我无法理解这个错误是如何发生的。任何帮助都将不胜感激。谢谢</p> <p>详细错误:</p> <hr/> <p>AttributeError回溯(最近一次呼叫上次) 在() ----&燃气轮机;1列车组,测试集=列车试验分割(t2data,试验尺寸=0.15,列车尺寸=0.85)</p> <p>2帧 /usr/local/lib/python3.6/dist-packages/pandas/core/generic.py in<strong>getattr</strong>(self,name) 5134如果自身信息轴可以保存标识符,并且保存名称(名称): 5135返回自我[姓名] -&燃气轮机;5136返回对象。<strong>getattribute</strong>(self,name) 5137 5138 def<strong>setattr</strong>(self,name:str,value)->;无:</p> <p>AttributeError:“DataFrame”对象没有属性“raw\u ratings”</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>您正在读取<code>rdata</code>变量中的CSV并拆分<code>t2data</code></p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
6 回答
无法使用Django\u mssql\u后端迁移到外部hos
4 回答
无法使用Django&Python3.4连接到MySql
5 回答
无法使用Django+nginx上载媒体文件
6 回答
无法使用Django1.6导入名称模式
9 回答
无法使用Django1.7和mongodb登录管理站点
7 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
6 回答
无法使用Djangockedi验证CBV中的字段
8 回答
无法使用Djangocketditor上载图像(错误400)
8 回答
无法使用Djangocron进行函数调用
1 回答
无法使用Djangofiler djang上载文件
5 回答
无法使用Djangokronos
2 回答
无法使用Djangomssql provid
8 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
1 回答
无法使用Djangomssq迁移Django数据库
4 回答
无法使用Djangonox创建用户
9 回答
无法使用Djangopyodb从Django查询SQL Server
8 回答
无法使用Djangopython3ldap连接到ldap
1 回答
无法使用Djangoredis连接到redis
9 回答
无法使用Django中的FK创建新表
5 回答