my code:
#building tf-idf
from sklearn.feature_extraction.text import TfidfVectorizer
vectorizer = TfidfVectorizer(analyzer = message_cleaning)
#X = vectorizer.fit_transform(corpus)
X = vectorizer.fit_transform(corpus)
#converting the result to array causes the prolem
X = pd.DataFrame(x.toarray())