我一直在处理一些文本数据,但很少有稀疏矩阵和密集(numpy 数组)。我只想知道如何正确组合它们。
这些是数组的类型和形状:
list1
<109248x9 sparse matrix of type '<class 'numpy.int64'>'
with 152643 stored elements in Compressed Sparse Row format>
list2
<109248x3141 sparse matrix of type '<class 'numpy.int64'>'
with 350145 stored elements in Compressed Sparse Row format>
list3.shape , type(list3)
(109248, 300) , numpy.ndarray
list4.shape , type
(109248, 51) , numpy.ndarray
我只想将所有这些组合在一起作为一个密集矩阵。我尝试了一些 vstack 和 hstack,但无法弄清楚。任何帮助深表感谢。
Output required: (109248, 3501)
摇曳的蔷薇
相关分类