scipy.sparse.csr.csr_matrix 未显示在变量资源管理器中



这个问题不是重复的,因为只有scipy.sparse.csr.csr_matrix类型没有显示在变量资源管理器中,而任何其他代码在执行时都会在变量资源管理器中成功显示。

我尝试重新启动Ipython内核以及Spyder以及Anaconda。

In [1]:from sklearn.feature_extraction.text import TfidfVectorizer
In [2]:tfidf = TfidfVectorizer(stop_words = 'english',ngram_range = (1,2),min_df = 5,sublinear_tf = True)
In [3]:fea = tfidf.fit_transform(df['text']) #this returns a scipy.sparse.csr.csr_matrix type
In [4]:type(fea)
Out[4]:scipy.sparse.csr.csr_matrix
In [5]:a_str = "qwertyuiop" #this shows in variable explorer

我可以正常使用 fea 变量,但我在变量资源管理器中看不到它。

编辑:

查看当前的Ipyhton活动变量,它将FEA显示为变量。

In [6]:print(dir())
Out [6]:['TfidfVectorizer','fea','a_str','tfidf','df']

正如卡洛斯在上面评论的那样,它起作用了,我需要在 spyder 的变量资源管理器中取消选择 Exclude unsupported data types 选项。

最新更新