Skip to content
This repository was archived by the owner on Nov 14, 2018. It is now read-only.

Commit 9d95a97

Browse files
committed
Made subtraction behavior consistent with addition
1 parent b82a4e6 commit 9d95a97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/index.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,10 @@ def __add__(self, other):
11411141
__ge__ = _indexOp('__ge__')
11421142

11431143
def __sub__(self, other):
1144-
return self.diff(other)
1144+
if isinstance(other, Index):
1145+
return self.diff(other)
1146+
else:
1147+
return Index(np.array(self) - other)
11451148

11461149
def __and__(self, other):
11471150
return self.intersection(other)

0 commit comments

Comments
 (0)