How to append a list of csr matrices
<p>I have a list of <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html" rel="nofollow">csr matrices</a> in a list called <code>L</code>. All the matrices have the same dimension which is <code>1</code> by <code>100000</code>. How can I append them so I end up with one csr matrix of dimension <code>len(L)</code> by <code>100000</code>?</p>

<p>I think a <em>vertical stack</em> i.e. <a href="http://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy.sparse.vstack.html" rel="nofollow"><code>vstack</code></a> will do:</p>

<pre><code>from scipy.sparse import vstack

new_array = vstack(L).toarray()
</code></pre>

python scipy