scipy.sparse
dok_matrix.
shape
Get shape of a matrix.
scipy.sparse.dok_matrix
scipy.sparse.dok_matrix.nnz