Hi, everybody
I am doing a systematic literature review and I copied all the references used in my sample. I would like to identify the most common words in order to identify the authors most citted. I did this so far:
I was able to identify every word's number, but I do not know how to present from the terms with the most frequent to the fewer ones. Can somebody help me?
I am doing a systematic literature review and I copied all the references used in my sample. I would like to identify the most common words in order to identify the authors most citted. I did this so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import sys print (sys.argv[ 1 ]) f = open (sys.argv[ 1 ]) my_file_contents = f.read() #print(f.read()) def word_count( str ): counts = dict () words = str .split() for word in words: if word in counts: counts[word] + = 1 else : counts[word] = 1 return counts print (word_count(my_file_contents)) |
nilamo write Feb-05-2021, 08:30 PM:
Please use python tags in the future
Please use python tags in the future