def _maybe_mask_result(self, result, mask, other, op_name):
<EOL>if is_float_dtype(result):<EOL><INDENT>mask |= (result == np.inf) | (result == -np.inf)<EOL><DEDENT>if ((is_float_dtype(other) or is_float(other)) or<EOL>(op_name in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])):<EOL><INDENT>result[mask] = np.nan<EOL>return result<EOL><DEDENT>return type(self)(result, mask, copy=False)<EOL>
Parameters
----------
result : array-like
mask : array-like bool
other : scalar or array-like
op_name : str