12
12
13
13
from pandas .core .api import DataFrame , Panel
14
14
from pandas .computation import expressions as expr
15
- from pandas import compat
15
+ from pandas import compat , _np_version_under1p12
16
16
from pandas .util .testing import (assert_almost_equal , assert_series_equal ,
17
17
assert_frame_equal , assert_panel_equal ,
18
18
assert_panel4d_equal , slow )
@@ -78,6 +78,13 @@ def run_arithmetic_test(self, df, other, assert_func, check_dtype=False,
78
78
if not compat .PY3 :
79
79
operations .append ('div' )
80
80
for arith in operations :
81
+
82
+ # numpy >= 1.12 doesn't handle integers
83
+ # raised to integer powers
84
+ # https://github.com/pandas-dev/pandas/issues/15363
85
+ if arith == 'pow' and not _np_version_under1p12 :
86
+ continue
87
+
81
88
operator_name = arith
82
89
if arith == 'div' :
83
90
operator_name = 'truediv'
@@ -90,6 +97,7 @@ def run_arithmetic_test(self, df, other, assert_func, check_dtype=False,
90
97
expr .set_use_numexpr (False )
91
98
expected = op (df , other )
92
99
expr .set_use_numexpr (True )
100
+
93
101
result = op (df , other )
94
102
try :
95
103
if check_dtype :
@@ -273,6 +281,13 @@ def testit():
273
281
274
282
for op , op_str in [('add' , '+' ), ('sub' , '-' ), ('mul' , '*' ),
275
283
('div' , '/' ), ('pow' , '**' )]:
284
+
285
+ # numpy >= 1.12 doesn't handle integers
286
+ # raised to integer powers
287
+ # https://github.com/pandas-dev/pandas/issues/15363
288
+ if op == 'pow' and not _np_version_under1p12 :
289
+ continue
290
+
276
291
if op == 'div' :
277
292
op = getattr (operator , 'truediv' , None )
278
293
else :
0 commit comments