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