I am using
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)
working on nltk with python3.6, when I am trying to get plot of frequency distribution an error is coming.
Trying below script
from nltk.book import *
freq = FreqDist(text5)
freq12 = freq.keys()
freq12.plot(50, cumulative=True)
I receive the following traceback
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'
How do I get plot while using python 3.6?
I have never used the library, but guessing based on some other question in SO I think
freq12.plot(50, cumulative=True)
should be
freq.plot(50, cumulative=True)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments