Guest User

Untitled

a guest
Jan 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. proposicoes[proposicoes['id'] == '465465']['ementa_token'].iloc[0]
  2. ['Comunica',
  3. 'Excelentíssimo',
  4. 'Senhor',
  5. 'Presidente',
  6. 'República',
  7. 'sanção',
  8. 'projeto',
  9. 'lei',
  10. 'Institui',
  11. 'Fundo',
  12. 'Nacional',
  13. 'Idoso',
  14. 'autoriza',
  15. 'deduzir',
  16. 'imposto',
  17. 'renda',
  18. 'devido',
  19. 'pessoas',
  20. 'físicas',
  21. 'jurídicas',
  22. 'doações',
  23. 'efetuadas',
  24. 'Fundos',
  25. 'Municipais',
  26. 'Estaduais',
  27. 'Nacional',
  28. 'Idoso',
  29. 'altera',
  30. 'Lei',
  31. 'nº',
  32. '9250',
  33. '26',
  34. 'dezembro',
  35. '1995',
  36. 'restitui',
  37. 'arquivo',
  38. 'Congresso',
  39. 'Nacional',
  40. 'dois',
  41. 'autógrafos',
  42. 'texto',
  43. 'ora',
  44. 'convertido',
  45. 'Lei',
  46. 'nº',
  47. '12213',
  48. '20',
  49. 'janeiro',
  50. '2010']
  51.  
  52. from wordcloud import WordCloud
  53. import matplotlib.pyplot as plt
  54. %matplotlib inline
  55.  
  56. wordcloud = WordCloud(width=800, height=400).generate(proposicoes['ementa_token'])
  57. plt.figure( figsize=(30,20) )
  58. plt.imshow(wordcloud)
  59. plt.axis("off")
  60. plt.show()
  61.  
  62. ---------------------------------------------------------------------------
  63. TypeError Traceback (most recent call last)
  64. <ipython-input-18-c072e91a9fe7> in <module>
  65. ----> 1 wordcloud = WordCloud(width=800, height=400).generate(proposicoes['ementa_token'])
  66. 2 plt.figure( figsize=(30,20) )
  67. 3 plt.imshow(wordcloud)
  68. 4 plt.axis("off")
  69. 5 plt.show()
  70.  
  71. c:usersreinaldodocumentscodepalavraslibsite-packageswordcloudwordcloud.py in generate(self, text)
  72. 603 self
  73. 604 """
  74. --> 605 return self.generate_from_text(text)
  75. 606
  76. 607 def _check_generated(self):
  77.  
  78. c:usersreinaldodocumentscodepalavraslibsite-packageswordcloudwordcloud.py in generate_from_text(self, text)
  79. 584 self
  80. 585 """
  81. --> 586 words = self.process_text(text)
  82. 587 self.generate_from_frequencies(words)
  83. 588 return self
  84.  
  85. c:usersreinaldodocumentscodepalavraslibsite-packageswordcloudwordcloud.py in process_text(self, text)
  86. 551 regexp = self.regexp if self.regexp is not None else r"w[w']+"
  87. 552
  88. --> 553 words = re.findall(regexp, text, flags)
  89. 554 # remove stopwords
  90. 555 words = [word for word in words if word.lower() not in stopwords]
  91.  
  92. c:usersreinaldodocumentscodepalavraslibre.py in findall(pattern, string, flags)
  93. 221
  94. 222 Empty matches are included in the result."""
  95. --> 223 return _compile(pattern, flags).findall(string)
  96. 224
  97. 225 def finditer(pattern, string, flags=0):
  98.  
  99. TypeError: expected string or bytes-like object
Add Comment
Please, Sign In to add comment