SciPy

scipy.sparse.dok_matrix.values

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