We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f26de1 commit eb34853Copy full SHA for eb34853
pandas/core/indexes/multi.py
@@ -3522,14 +3522,9 @@ def equal_levels(self, other) -> bool:
3522
3523
def _union(self, other, sort):
3524
other, result_names = self._convert_can_do_setop(other)
3525
+ result = super()._union(other, sort)
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
- )
+ return MultiIndex.from_tuples(result, sortorder=0, names=result_names)
3533
3534
def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
3535
return is_object_dtype(dtype)
0 commit comments