unfold_idx function

Fold and Unfold a dfidx object