Python Forum
how to calculate a maximum frequency of theterm in docuemnt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to calculate a maximum frequency of theterm in docuemnt
#4
You have selected most common word with [0] in your statement, so terms is list with just two items - word and its count. When you iterate over it, you are getting word first and count second - you cant unpack it.

If you remove your [0], it will be possible to iterate over it ( k, v will be word, wordcount ). But if you want only count of most common word, just use terms[1] with your original terms.
Reply


Messages In This Thread
RE: how to calculate a maximum frequency of theterm in docuemnt - by zivoni - Feb-27-2017, 11:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to calculate frequency of word in list desul 4 4,422 Feb-28-2017, 03:05 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020