diff --git a/pandas/core/computation/ops.py b/pandas/core/computation/ops.py index 9c54065de0353..5233ec65a1bb2 100644 --- a/pandas/core/computation/ops.py +++ b/pandas/core/computation/ops.py @@ -569,6 +569,7 @@ class UnaryOp(Op): def __init__(self, op: str, operand) -> None: super().__init__(op, (operand,)) self.operand = operand + self.value = operand try: self.func = _unary_ops_dict[op]