@@ -713,7 +713,8 @@ def _combine(self, other, func, axis=0):
713
713
(str (type (other )), str (type (self ))))
714
714
715
715
def _combine_const (self , other , func ):
716
- new_values = func (self .values , other )
716
+ with np .errstate (all = 'ignore' ):
717
+ new_values = func (self .values , other )
717
718
d = self ._construct_axes_dict ()
718
719
return self ._constructor (new_values , ** d )
719
720
@@ -723,14 +724,15 @@ def _combine_frame(self, other, func, axis=0):
723
724
724
725
other = other .reindex (index = index , columns = columns )
725
726
726
- if axis == 0 :
727
- new_values = func (self .values , other .values )
728
- elif axis == 1 :
729
- new_values = func (self .values .swapaxes (0 , 1 ), other .values .T )
730
- new_values = new_values .swapaxes (0 , 1 )
731
- elif axis == 2 :
732
- new_values = func (self .values .swapaxes (0 , 2 ), other .values )
733
- new_values = new_values .swapaxes (0 , 2 )
727
+ with np .errstate (all = 'ignore' ):
728
+ if axis == 0 :
729
+ new_values = func (self .values , other .values )
730
+ elif axis == 1 :
731
+ new_values = func (self .values .swapaxes (0 , 1 ), other .values .T )
732
+ new_values = new_values .swapaxes (0 , 1 )
733
+ elif axis == 2 :
734
+ new_values = func (self .values .swapaxes (0 , 2 ), other .values )
735
+ new_values = new_values .swapaxes (0 , 2 )
734
736
735
737
return self ._constructor (new_values , self .items , self .major_axis ,
736
738
self .minor_axis )
@@ -744,7 +746,8 @@ def _combine_panel(self, other, func):
744
746
this = self .reindex (items = items , major = major , minor = minor )
745
747
other = other .reindex (items = items , major = major , minor = minor )
746
748
747
- result_values = func (this .values , other .values )
749
+ with np .errstate (all = 'ignore' ):
750
+ result_values = func (this .values , other .values )
748
751
749
752
return self ._constructor (result_values , items , major , minor )
750
753
@@ -1011,7 +1014,8 @@ def apply(self, func, axis='major', **kwargs):
1011
1014
# try ufunc like
1012
1015
if isinstance (f , np .ufunc ):
1013
1016
try :
1014
- result = np .apply_along_axis (func , axis , self .values )
1017
+ with np .errstate (all = 'ignore' ):
1018
+ result = np .apply_along_axis (func , axis , self .values )
1015
1019
return self ._wrap_result (result , axis = axis )
1016
1020
except (AttributeError ):
1017
1021
pass
@@ -1113,7 +1117,8 @@ def _reduce(self, op, name, axis=0, skipna=True, numeric_only=None,
1113
1117
axis_number = self ._get_axis_number (axis_name )
1114
1118
f = lambda x : op (x , axis = axis_number , skipna = skipna , ** kwds )
1115
1119
1116
- result = f (self .values )
1120
+ with np .errstate (all = 'ignore' ):
1121
+ result = f (self .values )
1117
1122
1118
1123
axes = self ._get_plane_axes (axis_name )
1119
1124
if result .ndim == 2 and axis_name != self ._info_axis_name :
0 commit comments