I have a pandas data frame with the number of words for a number of documents. Can I apply sklearn.feature_extraction.text.TfidfVectorizerto it to return the term-document matrix?
import pandas as pd
a = [1,2,3,4]
b = [1,3,4,6]
c = [3,4,6,1]
df = pd.DataFrame([a,b,c])
How to get tfidf version of counts in df?
source
share