|
15 | 15 | from pandas.core.dtypes.common import (
|
16 | 16 | ensure_platform_int,
|
17 | 17 | ensure_python_int,
|
18 |
| - is_dtype_equal, |
19 | 18 | is_float,
|
20 | 19 | is_integer,
|
21 | 20 | is_list_like,
|
@@ -483,42 +482,6 @@ def equals(self, other: object) -> bool:
|
483 | 482 | # --------------------------------------------------------------------
|
484 | 483 | # Set Operations
|
485 | 484 |
|
486 |
| - def intersection(self, other, sort=False): |
487 |
| - """ |
488 |
| - Form the intersection of two Index objects. |
489 |
| -
|
490 |
| - Parameters |
491 |
| - ---------- |
492 |
| - other : Index or array-like |
493 |
| - sort : False or None, default False |
494 |
| - Sort the resulting index if possible |
495 |
| -
|
496 |
| - .. versionadded:: 0.24.0 |
497 |
| -
|
498 |
| - .. versionchanged:: 0.24.1 |
499 |
| -
|
500 |
| - Changed the default to ``False`` to match the behaviour |
501 |
| - from before 0.24.0. |
502 |
| -
|
503 |
| - Returns |
504 |
| - ------- |
505 |
| - intersection : Index |
506 |
| - """ |
507 |
| - self._validate_sort_keyword(sort) |
508 |
| - self._assert_can_do_setop(other) |
509 |
| - other, _ = self._convert_can_do_setop(other) |
510 |
| - |
511 |
| - if self.equals(other) and not self.has_duplicates: |
512 |
| - # has_duplicates check is unnecessary for RangeIndex, but |
513 |
| - # used to match other subclasses. |
514 |
| - return self._get_reconciled_name_object(other) |
515 |
| - |
516 |
| - if not is_dtype_equal(self.dtype, other.dtype): |
517 |
| - return super().intersection(other, sort=sort) |
518 |
| - |
519 |
| - result = self._intersection(other, sort=sort) |
520 |
| - return self._wrap_setop_result(other, result) |
521 |
| - |
522 | 485 | def _intersection(self, other, sort=False):
|
523 | 486 |
|
524 | 487 | if not isinstance(other, RangeIndex):
|
|
0 commit comments