Sparse matrix with DIAgonal storage
Examples
>>> from scipy.sparse import *
>>> from scipy import *
>>> dia_matrix( (3,4), dtype=int8).todense()
matrix([[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]], dtype=int8)
>>> data = array([[1,2,3,4]]).repeat(3,axis=0)
>>> offsets = array([0,-1,2])
>>> dia_matrix( (data,offsets), shape=(4,4)).todense()
matrix([[1, 0, 3, 0],
[1, 2, 0, 4],
[0, 2, 3, 0],
[0, 0, 3, 4]])
Methods
asformat | |
asfptype | |
astype | |
conj | |
conjugate | |
copy | Generic (shallow and deep) copying operations. |
diagonal | |
dot | |
getH | |
get_shape | |
getcol | |
getformat | |
getmaxprint | |
getnnz | |
getrow | |
mean | |
multiply | |
nonzero | |
reshape | |
set_shape | |
setdiag | |
sum | |
toarray | |
tobsr | |
tocoo | |
tocsc | |
tocsr | |
todense | |
todia | |
todok | |
tolil | |
transpose |