I need to replace the values of one level of pandas MultiIndex with another set of values. This is easily done with set_levels unless the new set contains duplicates, i.e. two or more values from the original set of level values are mapped to the same value in the new set. Doing so results in error. There is a brute force way of making this work by getting all index values (instead of levels) as MultiIndex of tuples, mapping to the new level in this space, then replacing the original index with a new MultiIndex constructed with from_tuples method. Is there a better way?