-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
EnhancementIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
Description
Curious about why Index.__add__
tries does the natural thing but Index.__sub__
raises TypeError
.
def __add__(self, other):
return Index(np.array(self) + other)
def __radd__(self, other):
return Index(other + np.array(self))
__iadd__ = __add__
def __sub__(self, other):
raise TypeError("cannot perform __sub__ with this index type: "
"{typ}".format(typ=type(self)))
Metadata
Metadata
Assignees
Labels
EnhancementIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves