Skip to content

Instantly share code, notes, and snippets.

@MarynaLongnickel
Created June 16, 2018 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarynaLongnickel/91a8a94e38f29d0795acbbd3f53eb0e3 to your computer and use it in GitHub Desktop.
Save MarynaLongnickel/91a8a94e38f29d0795acbbd3f53eb0e3 to your computer and use it in GitHub Desktop.
word_matrix = []
for i in lemmatized: word_matrix.append([1 if j in i else 0 for j in top5000])
features = pd.DataFrame(word_matrix, columns = top5000, index = pd.DataFrame(filtered_tokens))
features['sentiment'] = data['sentiment'].values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment