多くの投稿を検索しましたが、役に立たないようです。
フォルダー dir1/ には、main.py と plotcluster.py があります。plotcluster.py には次のものがあります。
import matplotlib as plt
import itertools as it
....
def plotc():
colors = it.cycle('ybmgk')
....
plt.figure()
....
main.py では、plotcluster.py を使用します。
import plotcluster as plc
....
plc.plotc()
しかし、これにより、モジュールオブジェクトが呼び出し可能ではないというエラーが表示されます。
20 linestyles = it.cycle('-:_')
21
---> 22 plt.figure()
23 # plot the most frequent ones first
24 for iter_count, (i, _) in enumerate(Counter(centerid).most_common()):
TypeError: 'module' object is not callable
itertools モジュールについては文句はありませんが、plt モジュールが気になります。これは私をとても混乱させます!
どんな助けでも大歓迎です!! 前もって感謝します!