Skip to content

Commit 407618a

Browse files
committed
clear code
1 parent ec2f9b1 commit 407618a

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

pandas/core/indexes/interval.py

-27
Original file line numberDiff line numberDiff line change
@@ -1091,33 +1091,6 @@ def equals(self, other):
10911091
def overlaps(self, other):
10921092
return self._data.overlaps(other)
10931093

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-
11211094
def intersection(self, other, sort=False):
11221095
other = self._as_like_interval_index(other)
11231096

0 commit comments

Comments
 (0)