と の 2 つcsr_matrix
がuniFeature
ありbiFeature
ます。
新しいマトリックスが欲しいFeature = [uniFeature, biFeature]
。しかし、この方法でそれらを直接連結すると、行列Feature
がリストであるというエラーが発生します。マトリックス連結を達成し、同じタイプのマトリックス、つまり a を取得するにはどうすればよいcsr_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_