![](/img/trans.png)
[英]strange error message: 'dict_keys' object has no attribute 'pop'
[英]dict_keys object has no attribute plot while using nltk
我在用
python 3.6(Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32)
使用python3.6在nltk上工作時,當我嘗試獲取頻率分布圖時,出現錯誤。
嘗試以下腳本
from nltk.book import *
freq = FreqDist(text5)
freq12 = freq.keys()
freq12.plot(50, cumulative=True)
我收到以下回溯
Traceback (most recent call last):
File "<pyshell#52>", line 1, in <module>
freq12.plot(50, cumulative=True)
AttributeError: 'dict_keys' object has no attribute 'plot'
使用python 3.6時如何獲取圖?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.