def _csr_matrix_indices(S):
 (m, n) = S.shape
 for i in range(m):
  for j in range(S.indptr[i], S.indptr[(i + 1)]):
   (row_index, col_index) = (i, S.indices[j])
   (yield (row_index, col_index))

def _csr_matrix_indices ( S ) : ( m , n ) = S . shape for i in range ( m ) : for j in range ( S . indptr [ i ] , S . indptr [ ( i + 1 ) ] ) : ( row_index , col_index ) = ( i , S . indices [ j ] ) ( yield ( row_index , col_index ) )
generate the indices of nonzero entries of a csr_matrix s .