Skip to content

Commit 603dbdc

Browse files
jbrockmendeljreback
authored andcommitted
CLN: remove unnecessary validate_for_numeric_unary (#27891)
1 parent 5c81d8a commit 603dbdc

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

pandas/core/indexes/base.py

-11
Original file line numberDiff line numberDiff line change
@@ -5341,16 +5341,6 @@ def _maybe_update_attributes(self, attrs):
53415341
"""
53425342
return attrs
53435343

5344-
def _validate_for_numeric_unaryop(self, op, opstr):
5345-
"""
5346-
Validate if we can perform a numeric unary operation.
5347-
"""
5348-
if not self._is_numeric_dtype:
5349-
raise TypeError(
5350-
"cannot evaluate a numeric op "
5351-
"{opstr} for type: {typ}".format(opstr=opstr, typ=type(self).__name__)
5352-
)
5353-
53545344
@classmethod
53555345
def _add_numeric_methods_binary(cls):
53565346
"""
@@ -5383,7 +5373,6 @@ def _add_numeric_methods_unary(cls):
53835373
def _make_evaluate_unary(op, opstr):
53845374
def _evaluate_numeric_unary(self):
53855375

5386-
self._validate_for_numeric_unaryop(op, opstr)
53875376
attrs = self._get_attributes_dict()
53885377
attrs = self._maybe_update_attributes(attrs)
53895378
return Index(op(self.values), **attrs)

0 commit comments

Comments
 (0)