dict_keys object has no attribute plot while using nltk

Gaurav

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?

Grzegorz Oledzki

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Error: " 'dict' object has no attribute 'iteritems' "

From Dev

'module' object has no attribute 'loads' while parsing JSON using python

From Dev

Object has no attribute using argparse

From Dev

'unicode' object has no attribute 'keys'

From Dev

plot.subplot ---> 'Figure' object has no attribute 'plot'

From Dev

NLTK python error: "TypeError: 'dict_keys' object is not subscriptable"

From Dev

'dict' object has no attribute 'read'

From Dev

'numpy.float64' object has no attribute 'plot'

From Dev

dict_items object has no attribute 'sort'

From Dev

TypeError: 'WordListCorpusReader' object has no attribute '__getitem__' while using nltk.classify.apply_features

From Dev

Django 'dict' object has no attribute 'getlist'

From Dev

While using casefold(), I am getting an error as " AttributeError: 'str' object has no attribute 'casefold' "

From Dev

'dict' object has no attribute 'id'

From Dev

AttributeError: 'module' object has no attribute 'LogicParser' with nltk.LogicParser()

From Dev

AttributeError: 'dict' object has no attribute 'predictors'

From Dev

AttributeError: 'Figure' object has no attribute 'plot'

From Dev

Plot MINST dataset images returns AttributeError: 'dict' object has no attribute 'train'

From Dev

AttributeError: type object 'HashStore' has no attribute 'hashtag' while using datastore in appengine

From Dev

while statement giving 'float' object has no attribute '__getitem__' error using numpy

From Dev

AttributeError: 'module' object has no attribute 'LogicParser' with nltk.LogicParser()

From Dev

Error while using pattern API [ERROR: ('NoneType' object has no attribute 'title')]

From Dev

AttributeError: 'numpy.ndarray' object has no attribute 'plot'

From Dev

'dict' object has no attribute 'push'

From Dev

AttributeError: 'str' object has no attribute 'decode' while reading from AVRO using Python

From Dev

python plot: object has no attribute 'set_xlable'

From Dev

Django Error While Using PyCharm: "'function' object has no attribute 'using'"

From Dev

Access dictionary objects inside list using loop throwing error : list' object has no attribute 'keys or unicode' object has no attribute 'keys

From Dev

AttributeError: 'dict' object has no attribute '____'

From Dev

AttributeError: 'dict' object has no attribute 'plot'

Related Related

  1. 1

    Error: " 'dict' object has no attribute 'iteritems' "

  2. 2

    'module' object has no attribute 'loads' while parsing JSON using python

  3. 3

    Object has no attribute using argparse

  4. 4

    'unicode' object has no attribute 'keys'

  5. 5

    plot.subplot ---> 'Figure' object has no attribute 'plot'

  6. 6

    NLTK python error: "TypeError: 'dict_keys' object is not subscriptable"

  7. 7

    'dict' object has no attribute 'read'

  8. 8

    'numpy.float64' object has no attribute 'plot'

  9. 9

    dict_items object has no attribute 'sort'

  10. 10

    TypeError: 'WordListCorpusReader' object has no attribute '__getitem__' while using nltk.classify.apply_features

  11. 11

    Django 'dict' object has no attribute 'getlist'

  12. 12

    While using casefold(), I am getting an error as " AttributeError: 'str' object has no attribute 'casefold' "

  13. 13

    'dict' object has no attribute 'id'

  14. 14

    AttributeError: 'module' object has no attribute 'LogicParser' with nltk.LogicParser()

  15. 15

    AttributeError: 'dict' object has no attribute 'predictors'

  16. 16

    AttributeError: 'Figure' object has no attribute 'plot'

  17. 17

    Plot MINST dataset images returns AttributeError: 'dict' object has no attribute 'train'

  18. 18

    AttributeError: type object 'HashStore' has no attribute 'hashtag' while using datastore in appengine

  19. 19

    while statement giving 'float' object has no attribute '__getitem__' error using numpy

  20. 20

    AttributeError: 'module' object has no attribute 'LogicParser' with nltk.LogicParser()

  21. 21

    Error while using pattern API [ERROR: ('NoneType' object has no attribute 'title')]

  22. 22

    AttributeError: 'numpy.ndarray' object has no attribute 'plot'

  23. 23

    'dict' object has no attribute 'push'

  24. 24

    AttributeError: 'str' object has no attribute 'decode' while reading from AVRO using Python

  25. 25

    python plot: object has no attribute 'set_xlable'

  26. 26

    Django Error While Using PyCharm: "'function' object has no attribute 'using'"

  27. 27

    Access dictionary objects inside list using loop throwing error : list' object has no attribute 'keys or unicode' object has no attribute 'keys

  28. 28

    AttributeError: 'dict' object has no attribute '____'

  29. 29

    AttributeError: 'dict' object has no attribute 'plot'

HotTag

Archive