Possibly change the bin content type to allow correct operations with other operand.

        Parameters
        ----------
        other_dtype : np.dtype or type
546320
def _coerce_dtype(self, other_dtype):
        
        if self._dtype is None:
            new_dtype = np.dtype(other_dtype)
        else:
            new_dtype = np.find_common_type([self._dtype, np.dtype(other_dtype)], [])
        if new_dtype != self.dtype:
            self.set_dtype(new_dtype)
1241789
def fmod_with_float( other )
      other = Node.match( other, typecode ).new other unless other.matched?
      if typecode < FLOAT_ or other.typecode < FLOAT_
        fmod other
      else
        fmod_without_float other
      end
    end
340283
def build_binary_op(self, op, other):
        
        if isinstance(other, NumericalExpression):
            self_expr, other_expr, new_inputs = self._merge_expressions(other)
        elif isinstance(other, Term):
            self_expr = self._expr
            new_inputs, other_idx = _ensure_element(self.inputs, other)
            other_expr = "x_%d" % other_idx
        elif isinstance(other, Number):
            self_expr = self._expr
            other_expr = str(other)
            new_inputs = self.inputs
        else:
            raise BadBinaryOperator(op, other)
        return self_expr, other_expr, new_inputs
165087
def get_type(var):
    
    if HAVE_NUMPY and isinstance(var, np.ndarray):
        if _WIN32:
            # This is a weird system specific error
            # https://github.com/numpy/numpy/issues/3667
            type_ = var.dtype
        else:
            type_ = var.dtype.type
    elif HAVE_PANDAS and isinstance(var, pd.Index):
        if _WIN32:
            type_ = var.dtype
        else:
            type_ = var.dtype.type
    else:
        type_ = type(var)
    return type_
542087
def data_type_to_numpy(datatype, unsigned=False):
    """"""
    basic_type = _dtypeLookup[datatype]

    if datatype in (stream.STRING, stream.OPAQUE):
        return np.dtype(basic_type)

    if unsigned:
        basic_type = basic_type.replace('i', 'u')
    return np.dtype('=' + basic_type)
187030
def fill_value(dtype):
    '''
    '''
    if np.issubdtype(dtype, np.floating) or np.issubdtype(dtype, np.complexfloating):
        return dtype(np.nan)

    return dtype(0)
546450
def absorb(self, other):
        
        if not isinstance(other, self.__class__):
            raise TypeError("`other` has to be a instance of %s!" %
                            self.__class__)

        for attr, value in other.items():
            if value is not None:
                setattr(self, attr, deepcopy(value))
405197
def dtyping(*args):
    
    args = list(args)

    for idx, arg in enumerate(args):

        if isinstance(arg, Poly):
            args[idx] = Poly

        elif isinstance(arg, numpy.generic):
            args[idx] = numpy.asarray(arg).dtype

        elif isinstance(arg, (float, int)):
            args[idx] = type(arg)

    for type_ in DATATYPES:
        if type_ in args:
            return type_

    raise ValueError(
        "dtypes not recognised " + str([str(_) for _ in args]))
1211065
def suits_with_dtype(mn, mx, dtype):
    
    type_info = np.iinfo(dtype)
    if mx <= type_info.max and mn >= type_info.min:
        return True
    else:
        return False
246811
def _astype(self, dtype):
        
        kwargs = {}
        if is_floating_dtype(dtype):
            # Use weighting only for floating-point types, otherwise, e.g.,
            # `space.astype(bool)` would fail
            weighting = getattr(self, 'weighting', None)
            if weighting is not None:
                kwargs['weighting'] = weighting

        return type(self)(self.shape, dtype=dtype, **kwargs)
1282775
def binary_op(data, op, other, blen=None, storage=None, create='array',
              **kwargs):
    """"""

    # normalise scalars
    if hasattr(other, 'shape') and len(other.shape) == 0:
        other = other[()]

    if np.isscalar(other):
        def f(block):
            return op(block, other)
        return map_blocks(data, f, blen=blen, storage=storage, create=create, **kwargs)

    elif len(data) == len(other):
        def f(a, b):
            return op(a, b)
        return map_blocks((data, other), f, blen=blen, storage=storage, create=create,
                          **kwargs)

    else:
        raise NotImplementedError('argument type not supported')
1111148
def contains_all(self, other):
        """"""
        dtype = getattr(other, 'dtype', None)
        if dtype is None:
            dtype = np.result_type(*other)
        dtype_str = np.dtype('S{}'.format(self.length))
        dtype_uni = np.dtype('<U{}'.format(self.length))
        return dtype in (dtype_str, dtype_uni)
382414
def _prep_binary_mimetype(self):

		'''
		
		'''

		# neither present
		if not self.mimetype and 'Content-Type' not in self.resource.headers.keys():
			raise Exception('to create/update NonRDFSource, mimetype or Content-Type header is required')

		# mimetype, no Content-Type
		elif self.mimetype and 'Content-Type' not in self.resource.headers.keys():
			logger.debug('setting Content-Type header with provided mimetype: %s'
				% self.mimetype)
			self.resource.headers['Content-Type'] = self.mimetype
979579
def _maybe_mask_result(self, result, mask, other, op_name):
        

        # may need to fill infs
        # and mask wraparound
        if is_float_dtype(result):
            mask |= (result == np.inf) | (result == -np.inf)

        # if we have a float operand we are by-definition
        # a float result
        # or our op is a divide
        if ((is_float_dtype(other) or is_float(other)) or
                (op_name in ['rtruediv', 'truediv', 'rdiv', 'div'])):
            result[mask] = np.nan
            return result

        return type(self)(result, mask, copy=False)
596840
def _coerce_to_type(x):
    
    dtype = None

    if is_datetime64tz_dtype(x):
        dtype = x.dtype
    elif is_datetime64_dtype(x):
        x = to_datetime(x)
        dtype = np.dtype('datetime64[ns]')
    elif is_timedelta64_dtype(x):
        x = to_timedelta(x)
        dtype = np.dtype('timedelta64[ns]')

    if dtype is not None:
        # GH 19768: force NaT to NaN during integer conversion
        x = np.where(x.notna(), x.view(np.int64), np.nan)

    return x, dtype
440180
def _icheckother(fn, self, other):
        
        self._typecheck(other) 
        if type(other) in _ALLOWED_SCALARS:
            if self.kind == 'real' and type(other) == complex:
                raise TypeError('dtypes are incompatible')
            other = force_precision_to_match(other, self.precision)
        elif isinstance(other, type(self)) or type(other) is Array:
            if len(other) != len(self):
                raise ValueError('lengths do not match')
            if self.kind == 'real' and other.kind == 'complex':
                raise TypeError('dtypes are incompatible')
            if other.precision == self.precision:
                _convert_to_scheme(other)
                other = other._data
            else:
                raise TypeError('precisions do not match')
        else:
            return NotImplemented

        return fn(self, other)
439159
def _other_endian(typ):
    
    try:
        return getattr(typ, _OTHER_ENDIAN)
    except AttributeError:
        if type(typ) == _array_type:
            return _other_endian(typ._type_) * typ._length_
        raise TypeError("This type does not support other endian: %s" % typ)