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 />

setdiag(values, k=0)<br />

Fills the diagonal elements {a_ii} with the values from the given sequence. If k != 0, fills the off-diagonal<br />

elements {a_{i,i+k}} instead.<br />

values may have any length. If the diagonal is longer than values, then the remaining diagonal entries will<br />

not be set. If values if longer than the diagonal, then the remaining values are ignored.<br />

sum(axis=None)<br />

Sum the matrix over the given axis. If the axis is None, sum over both rows and columns, returning a<br />

scalar.<br />

toarray()<br />

tobsr(blocksize=None)<br />

tocoo(copy=False)<br />

tocsc()<br />

Return a copy of this matrix in Compressed Sparse Column format<br />

Duplicate entries will be summed together.<br />

tocsr()<br />

Return a copy of this matrix in Compressed Sparse Row format<br />

Duplicate entries will be summed together.<br />

todense()<br />

todia()<br />

todok()<br />

tolil()<br />

transpose(copy=False)<br />

class dia_matrix(arg1, shape=None, dtype=None, copy=False)<br />

Sparse matrix with DIAgonal storage<br />

This can be instantiated in several ways:<br />

dia_matrix(D)<br />

with a dense matrix<br />

dia_matrix(S)<br />

with another sparse matrix S (equivalent to S.todia())<br />

dia_matrix((M, N), [dtype])<br />

to construct an empty matrix with shape (M, N), dtype is optional, defaulting to dtype=’d’.<br />

dia_matrix((data, offsets), shape=(M, N))<br />

where the data[k,:] stores the diagonal entries for diagonal offsets[k] (See example below)<br />

380 Chapter 3. Reference

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

Saved successfully!

Ooh no, something went wrong!