Scipy error with sparse hstack
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: While attempting to combine dense and sparse data with scipy.spare.hstack, I'm occasionally running into the error: Traceback (most recent call last): File "hstack_error.py", line 3, in <module> X = scipy.sparse.hstack(hstack_parts) File "/usr/lib/python2.7/dist-packages/scipy/sparse/construct.py", line 263, in hstack return bmat([blocks], format=format, dtype=dtype) File "/usr/lib/python2.7/dist-packages/scipy/sparse/construct.py", line 329, in bmat raise ValueError('blocks must have rank 2') ValueError: blocks must have rank 2 Minimal code