标签:att ict 出现 方法 code sorted tee erro python3
在python3.6中
运行
sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), reverse=True)
会出现AttributeError: ‘dict‘ object has no attribute ‘iteritems‘的错误提醒
纠正错误的方法为:
iteritems变为items
即
sortedClassCount = sorted(classCount.items(), key=operator.itemgetter(1), reverse=True)
AttributeError: 'dict' object has no attribute 'iteritems'
标签:att ict 出现 方法 code sorted tee erro python3
原文地址:https://www.cnblogs.com/277223178dudu/p/9642351.html