@classmethod<EOL><INDENT>def _add_numeric_methods_unary(cls):<DEDENT>
def _make_evaluate_unary(op, opstr):<EOL><INDENT>def _evaluate_numeric_unary(self):<EOL><INDENT>self._validate_for_numeric_unaryop(op, opstr)<EOL>attrs = self._get_attributes_dict()<EOL>attrs = self._maybe_update_attributes(attrs)<EOL>return Index(op(self.values), **attrs)<EOL><DEDENT>_evaluate_numeric_unary.__name__ = opstr<EOL>return _evaluate_numeric_unary<EOL><DEDENT>cls.__neg__ = _make_evaluate_unary(operator.neg, '<STR_LIT>')<EOL>cls.__pos__ = _make_evaluate_unary(operator.pos, '<STR_LIT>')<EOL>cls.__abs__ = _make_evaluate_unary(np.abs, '<STR_LIT>')<EOL>cls.__inv__ = _make_evaluate_unary(lambda x: -x, '<STR_LIT>')<EOL>
Add in numeric unary methods.