成功解决AttributeError: ‘dict_values‘ object has no attribute ‘index‘
成功解决AttributeError: 'dict_values' object has no attribute 'index'
解决问题
AttributeError: 'dict_values' object has no attribute 'index'
解决思路
属性错误:“age_dict”对象没有属性“index”
解决方法
将
print(age_dict.keys())
改为
Print(list(age_dict.keys()))
相关推荐
-
python笔记58-类里面的__dict__属性
前言 python是面向对象的,对象有属性和方法,可以通过__dict__查看对象的属性 dict查看对象属性 首先弄清楚2个概念,类(A)和类的实例对象(A()), 如下代码 count 是A的类属 ...
-
面向对象编程(二)
使用__slots__ 正常情况下,当我们定义了一个class,创建了一个class的实例后,我们可以给该实例绑定任何属性和方法,这就是动态语言的灵活性.先定义class: class Student ...
-
python笔记61 - __getattr__ 属性查找学习与使用
前言 object 类里面有个 __getattribute__ 方法,作用是类实例化调用属性和方法的时候都会调用一次,返回该类的属性. 如果调用的属性没有,会抛出 AttributeError 异常 ...
-
成功解决AttributeError: 'NoneType' object has no attribute 'find_all'
成功解决AttributeError: 'NoneType' object has no attribute 'find_all' 解决问题 AttributeError: 'NoneType' ob ...
-
成功解决AttributeError: 'MapDataset' object has no attribute 'group_by_window'
成功解决AttributeError: 'MapDataset' object has no attribute 'group_by_window' 解决问题 AttributeError: 'Map ...
-
成功解决AttributeError: 'str' object has no attribute 'decode'
成功解决AttributeError: 'str' object has no attribute 'decode' 解决问题 AttributeError: 'str' object has no ...
-
成功解决AttributeError: 'BasicLSTMCell' object has no attribute '_kernel'+python下划线用法的几种常见用法理解
成功解决AttributeError: 'BasicLSTMCell' object has no attribute '_kernel'+python下划线用法的几种常见用法理解 解决问题 Attr ...
-
成功解决AttributeError: 'map' object has no attribute 'items'
成功解决AttributeError: 'map' object has no attribute 'items' 解决问题 AttributeError: 'map' object has no a ...
-
成功解决AttributeError: 'GradientBoostingRegressor' object has no attribute 'staged_decision_function'
成功解决AttributeError: 'GradientBoostingRegressor' object has no attribute 'staged_decision_function' 解 ...
-
成功解决AttributeError: 'Word2Vec' object has no attribute 'index2word'
成功解决AttributeError: 'Word2Vec' object has no attribute 'index2word' 解决问题 AttributeError: 'Word2Vec' ...
-
成功解决AttributeError: 'DataFrame' object has no attribute 'reshape'
成功解决AttributeError: 'DataFrame' object has no attribute 'reshape' 解决问题 AttributeError: 'DataFrame' o ...
-
成功解决AttributeError: 'list' object has no attribute 'shape'
成功解决AttributeError: 'list' object has no attribute 'shape' 解决问题 AttributeError: 'list' object has no ...