diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 7272d4e2752be..a2e0582da6ee3 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -5341,16 +5341,6 @@ def _maybe_update_attributes(self, attrs): """ return attrs - def _validate_for_numeric_unaryop(self, op, opstr): - """ - Validate if we can perform a numeric unary operation. - """ - if not self._is_numeric_dtype: - raise TypeError( - "cannot evaluate a numeric op " - "{opstr} for type: {typ}".format(opstr=opstr, typ=type(self).__name__) - ) - @classmethod def _add_numeric_methods_binary(cls): """ @@ -5383,7 +5373,6 @@ def _add_numeric_methods_unary(cls): def _make_evaluate_unary(op, opstr): def _evaluate_numeric_unary(self): - self._validate_for_numeric_unaryop(op, opstr) attrs = self._get_attributes_dict() attrs = self._maybe_update_attributes(attrs) return Index(op(self.values), **attrs)