This is documentation for an old release of SciPy (version 0.9.0). Read this page in the documentation of the latest stable release (version 1.15.1).
Dictionary Of Keys based sparse matrix.
This is an efficient structure for constructing sparse matrices incrementally.
Notes
Allows for efficient O(1) access of individual elements. Duplicates are not allowed. Can be efficiently converted to a coo_matrix once constructed.
Examples
>>> from scipy.sparse import *
>>> from scipy import *
>>> S = dok_matrix((5,5), dtype=float32)
>>> for i in range(5):
>>> for j in range(5):
>>> S[i,j] = i+j # Update element
Methods
asformat | |
asfptype | |
astype | |
clear | |
conj | |
conjtransp | |
conjugate | |
copy | Generic (shallow and deep) copying operations. |
diagonal | |
dot | |
fromkeys | |
get | |
getH | |
get_shape | |
getcol | |
getformat | |
getmaxprint | |
getnnz | |
getrow | |
has_key | |
items | |
iteritems | |
iterkeys | |
itervalues | |
keys | |
mean | |
multiply | |
nonzero | |
pop | |
popitem | |
reshape | |
resize | |
set_shape | |
setdefault | |
setdiag | |
split | |
sum | |
take | |
toarray | |
tobsr | |
tocoo | |
tocsc | |
tocsr | |
todense | |
todia | |
todok | |
tolil | |
transpose | |
update | |
values |