From 7da04441d647a04aed0e968cea75e54778545db8 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Mon, 12 Aug 2019 18:58:48 -0700 Subject: [PATCH 1/2] CLN: remove unnecessary validate_for_numeric_unary --- pandas/core/indexes/base.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 598c4dca9ce88..cb924e5f5974e 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -5374,16 +5374,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__) - ) - def _validate_for_numeric_binop(self, other, op): """ Return valid other; evaluate or raise TypeError if we are not of @@ -5461,7 +5451,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) From 4c2841297827ad713828e3f07edebe2d54ebe924 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Tue, 13 Aug 2019 08:30:20 -0700 Subject: [PATCH 2/2] dummy to force CI