@@ -1091,33 +1091,6 @@ def equals(self, other):
1091
1091
def overlaps (self , other ):
1092
1092
return self ._data .overlaps (other )
1093
1093
1094
- def intersection2 (self , other , sort = False ):
1095
- other = self ._as_like_interval_index (other )
1096
-
1097
- # GH 19016: ensure set op will not return a prohibited dtype
1098
- subtypes = [self .dtype .subtype , other .dtype .subtype ]
1099
- common_subtype = find_common_type (subtypes )
1100
- if is_object_dtype (common_subtype ):
1101
- msg = ('can only do intersection between two IntervalIndex '
1102
- 'objects that have compatible dtypes' )
1103
- raise TypeError (msg )
1104
-
1105
- try :
1106
- lindexer = other .left .get_indexer (self .left )
1107
- rindexer = other .right .get_indexer (self .right )
1108
- except Exception :
1109
- # duplicates
1110
- lindexer = algos .unique1d (
1111
- other .left .get_indexer_non_unique (self .left )[0 ])
1112
- rindexer = algos .unique1d (
1113
- other .right .get_indexer_non_unique (self .right )[0 ])
1114
-
1115
- match = (lindexer == rindexer ) & (lindexer != - 1 )
1116
- indexer = lindexer .take (match .nonzero ()[0 ])
1117
- taken = other .take (indexer )
1118
-
1119
- return taken
1120
-
1121
1094
def intersection (self , other , sort = False ):
1122
1095
other = self ._as_like_interval_index (other )
1123
1096
0 commit comments