2-tuple; but raise KeyError if D is empty.
scipy.sparse.dok_matrix.pop
scipy.sparse.dok_matrix.reshape