Last active
April 18, 2020 20:25
-
-
Save luisfredgs/f0e2f6bb8c89a7c0d81623cff3a16789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val=sorted(word_frequency.values()) | |
higher_word_frequencies = [word for word,freq in word_frequency.items() if freq in val[-3:]] | |
print("\nWords with higher frequencies: ", higher_word_frequencies) | |
# gets relative frequencies of words | |
higher_frequency = val[-1] | |
for word in word_frequency.keys(): | |
word_frequency[word] = (word_frequency[word]/higher_frequency) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment