Skip to content

Commit eb34853

Browse files
committed
Multiindex.union
1 parent 8f26de1 commit eb34853

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pandas/core/indexes/multi.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3522,14 +3522,9 @@ def equal_levels(self, other) -> bool:
35223522

35233523
def _union(self, other, sort):
35243524
other, result_names = self._convert_can_do_setop(other)
3525+
result = super()._union(other, sort)
35253526

3526-
# We could get here with CategoricalIndex other
3527-
rvals = other._values.astype(object, copy=False)
3528-
uniq_tuples = lib.fast_unique_multiple([self._values, rvals], sort=sort)
3529-
3530-
return MultiIndex.from_arrays(
3531-
zip(*uniq_tuples), sortorder=0, names=result_names
3532-
)
3527+
return MultiIndex.from_tuples(result, sortorder=0, names=result_names)
35333528

35343529
def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
35353530
return is_object_dtype(dtype)

0 commit comments

Comments
 (0)