Skip to content

Commit adf9d48

Browse files
committed
ENH: support alignable panel arithmetic methods
1 parent 275a42c commit adf9d48

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

pandas/core/panel.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,8 @@ def panel_index(time, panels, names=['time', 'panel']):
9292

9393

9494
def _arith_method(func, name):
95-
# work only for scalars
9695

9796
def f(self, other):
98-
if not np.isscalar(other):
99-
raise ValueError('Simple arithmetic with %s can only be '
100-
'done with scalar values' % self._constructor.__name__)
101-
10297
return self._combine(other, func)
10398
f.__name__ = name
10499
return f

pandas/tests/test_panel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ def test_arith(self):
266266
self._test_op(self.panel, lambda x, y: x / y) # panel / 1
267267
self._test_op(self.panel, lambda x, y: x ** y) # panel ** 1
268268

269-
self.assertRaises(Exception, self.panel.__add__, self.panel['ItemA'])
270-
271269
@staticmethod
272270
def _test_op(panel, op):
273271
result = op(panel, 1)

0 commit comments

Comments
 (0)