【问题标题】:TypeError: 'module' object is not callable ----TypeError:“模块”对象不可调用----
【发布时间】:2021-11-22 13:17:33
【问题描述】:

我的代码有以下相关行:

import collections as Counter

它输出以下内容:

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

TypeError: 'module' object is not callable

为什么会发生这种情况,我该如何解决?

【问题讨论】:

  • 投反对票,因为代码未格式化为代码。如果这个问题得到解决,我会删除downvote。

标签: python algorithm machine-learning data-science


【解决方案1】:

我想你的意思是from collections import Counter

【讨论】:

  • 是的,谢谢。解决了
猜你喜欢
  • 2017-06-17
  • 2014-09-21
  • 2011-05-30
  • 2017-05-08
  • 1970-01-01
  • 2021-12-24
相关资源
最近更新 更多