Skip to content

Commit 1909742

Browse files
committed
failing on __neg__ and __invert__ (only for a sparse panel); was wrapping array, now -1 * self
1 parent 8a30a5d commit 1909742

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/core/panel.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,10 @@ def _compare_constructor(self, other, func):
464464
__xor__ = _arith_method(operator.xor, '__xor__')
465465

466466
def __neg__(self):
467-
arr = operator.neg(self.values)
468-
return self._wrap_array(arr, self.axes, copy=False)
467+
return -1 * self
469468

470469
def __invert__(self):
471-
arr = operator.inv(self.values)
472-
return self._wrap_array(arr, self.axes, copy=False)
470+
return -1 * self
473471

474472
# Comparison methods
475473
__eq__ = _comp_method(operator.eq, '__eq__')

0 commit comments

Comments
 (0)