15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SciPy Reference Guide, Release 0.8.dev<br />

[3, 4, 6],<br />

[0, 0, 7]])<br />

>>> bmat( [[A,None],[None,C]] ).todense()<br />

matrix([[1, 2, 0],<br />

[3, 4, 0],<br />

[0, 0, 7]])<br />

hstack(blocks, format=None, dtype=None)<br />

Stack sparse matrices horizontally (column wise)<br />

See Also:<br />

Parameters<br />

blocks :<br />

sequence of sparse matrices with compatible shapes<br />

format : string<br />

sparse format of the result (e.g. “csr”) by default an appropriate sparse matrix format<br />

is returned. This choice is subject to change.<br />

vstack<br />

stack sparse matrices vertically (row wise)<br />

Examples<br />

>>> from <strong>scipy</strong>.sparse import coo_matrix, vstack<br />

>>> A = coo_matrix([[1,2],[3,4]])<br />

>>> B = coo_matrix([[5],[6]])<br />

>>> hstack( [A,B] ).todense()<br />

matrix([[1, 2, 5],<br />

[3, 4, 6]])<br />

vstack(blocks, format=None, dtype=None)<br />

Stack sparse matrices vertically (row wise)<br />

See Also:<br />

Parameters<br />

blocks :<br />

sequence of sparse matrices with compatible shapes<br />

format : string<br />

sparse format of the result (e.g. “csr”) by default an appropriate sparse matrix format<br />

is returned. This choice is subject to change.<br />

hstack<br />

stack sparse matrices horizontally (column wise)<br />

Examples<br />

>>> from <strong>scipy</strong>.sparse import coo_matrix, vstack<br />

>>> A = coo_matrix([[1,2],[3,4]])<br />

>>> B = coo_matrix([[5,6]])<br />

>>> vstack( [A,B] ).todense()<br />

390 Chapter 3. Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!