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