Skip to content

Instantly share code, notes, and snippets.

@Joshuaek
Last active November 6, 2017 20:47
Show Gist options
  • Save Joshuaek/70d4e3e85b0cfa50337f059064eb1b31 to your computer and use it in GitHub Desktop.
Save Joshuaek/70d4e3e85b0cfa50337f059064eb1b31 to your computer and use it in GitHub Desktop.
words = []
for tweet in tweets:
words.extend(prepareSentence(tweet["text"]))
distinct_words = set(words)
lower_threshold = 10
upper_threshold = 350
counts = []
final_words = []
for word in distinct_words:
counts.append(words.count(word))
if words.count(word) > lower_threshold and words.count(word) < upper_threshold:
final_words.append(word)
print(len(words))
print(len(distinct_words))
print(len(final_words))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment