@@ -4045,7 +4045,7 @@ def _evaluate_numeric_binop(self, other):
4045
4045
with np .errstate (all = 'ignore' ):
4046
4046
result = op (values , other )
4047
4047
4048
- result = dispatch_missing (op , values , other , result )
4048
+ result = missing . dispatch_missing (op , values , other , result )
4049
4049
return constructor (result , ** attrs )
4050
4050
4051
4051
return _evaluate_numeric_binop
@@ -4169,37 +4169,6 @@ def invalid_op(self, other=None):
4169
4169
Index ._add_comparison_methods ()
4170
4170
4171
4171
4172
- def dispatch_missing (op , left , right , result ):
4173
- """
4174
- Fill nulls caused by division by zero, casting to a diffferent dtype
4175
- if necessary.
4176
-
4177
- Parameters
4178
- ----------
4179
- op : function (operator.add, operator.div, ...)
4180
- left : object, usually Index
4181
- right : object
4182
- result : ndarray
4183
-
4184
- Returns
4185
- -------
4186
- result : ndarray
4187
- """
4188
- opstr = '__{opname}__' .format (opname = op .__name__ ).replace ('____' , '__' )
4189
- if op in [operator .truediv , operator .floordiv ,
4190
- getattr (operator , 'div' , None )]:
4191
- result = missing .mask_zero_div_zero (left , right , result )
4192
- elif op is operator .mod :
4193
- result = missing .fill_zeros (result , left , right ,
4194
- opstr , np .nan )
4195
- elif op is divmod :
4196
- res0 = missing .mask_zero_div_zero (left , right , result [0 ])
4197
- res1 = missing .fill_zeros (result [1 ], left , right ,
4198
- opstr , np .nan )
4199
- result = (res0 , res1 )
4200
- return result
4201
-
4202
-
4203
4172
def _ensure_index_from_sequences (sequences , names = None ):
4204
4173
"""Construct an index from sequences of data.
4205
4174
0 commit comments