其他分享
首页 > 其他分享> > 今日作业

今日作业

作者:互联网

from sklearn.feature_extraction.text import CountVectorizer
import pandas as pd
import numpy as np
df = pd.read_csv(‘51job.csv’)
a = np.array(df[‘title’])[:10]

list = []
for i in a:
con = ’ '.join(jieba.lcut(i))
list.append(con)

cv = CountVectorizer(stop_words=[‘高级’,‘支持’,‘平台’,‘变现’])
data = cv.fit_transform(list)
print(cv.get_feature_names())
print(data.toarray())

标签:CountVectorizer,作业,list,feature,pd,import,今日,cv
来源: https://blog.csdn.net/weixin_45011910/article/details/89885752