码
import numpy as np
from sklearn.feature_extraction.text import countVectorizer
count=countVectorizer
docs=np.array(['The sun is shinning',
'The weather is sweet',
'The sun is shinning,The weather is sweet, and one and one is two'])
bag= count.fit_transform(docs)误差输出
ImportError Traceback (most recent call last)
<ipython-input-1-e322748c3b4c> in <module>
1 import numpy as np
----> 2 from sklearn.feature_extraction.text import countVectorizer
3 count=countVectorizer
4 docs=np.array(['The sun is shinning',
5 'The weather is sweet',
ImportError: cannot import name 'countVectorizer' from 'sklearn.feature_extraction.text' (C:\ProgramData\Anaconda3\lib\site-packages\sklearn\feature_extraction\text.py)语句我得到了这个错误,帮助我解决它,我在anaconda导航提示中使用jupyter笔记本,我安装了最新版本的scikit-,但我也收到了相同的导入错误。然后还安装和卸载了scikit学习使用Anaconda命令提示符。
发布于 2020-11-02 09:38:30
从sklearn.feature_extraction.text导入CountVectorizer
正在工作
https://stackoverflow.com/questions/61563894
复制相似问题