Created
June 23, 2019 22:29
-
-
Save wtberry/199bbc5ae79bab48eae3fa03ee8607a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from sklearn.feature_extraction.text import CountVectorizer | |
# Initialize and fit CountVectorizer with given text documents | |
vectorizer = CountVectorizer().fit(df['name']) | |
# use the vectorizer to transform the document into word count vectors (Sparse) | |
word_mat = vectorizer.transform(df['name']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment