SciPy

scipy.sparse.dok_matrix.viewvalues

dok_matrix.viewvalues() → an object providing a view on D's values