类型错误: 'module'对象不可调用----



我的代码有以下相关行:

import collections as Counter

输出如下:

TypeError                                
<ipython-input-13-8b716be54873> in <module>
----> 1 print(sorted(Counter(dataset['Best']).items()))
TypeError: 'module' object is not callable

为什么会发生这种情况,我该如何修复它?

我想你指的是from collections import Counter

最新更新