我有两个csr_matrix
,uniFeature
和biFeature
。
我想要一个新的基质。但是如果我用这种方式直接连接它们,就会出现一个错误,说矩阵Feature
是一个列表。如何实现矩阵连接,并且仍然得到相同类型的矩阵,即acsr_matrix
?
如果我在连接之后这样做就不行了:Feature = csr_matrix(Feature)
它给出了错误:
Traceback (most recent call last):
File "yelpfilter.py", line 91, in <module>
Feature = csr_matrix(Feature)
File "c:\python27\lib\site-packages\scipy\sparse\compressed.py", line 66, in __init__
self._set_self( self.__class__(coo_matrix(arg1, dtype=dtype)) )
File "c:\python27\lib\site-packages\scipy\sparse\coo.py", line 185, in __init__
self.row, self.col = M.nonzero()
TypeError: __nonzero__ should return bool or int, returned numpy.bool_
^{} 模块包括函数^{} 和^{} 。
例如:
相关问题 更多 >
编程相关推荐