SciPy

scipy.sparse.dok_matrix.viewitems

dok_matrix.viewitems() → a set-like object providing a view on D's items