parameters: (lhs, rhs)
docstring: Perform element-wise subtract
  
      Parameters
      ----------
      lhs : Array or float value
          left hand side operand
  
      rhs : Array of float value
          right hand side operand
  
      Returns
      -------
      out: Array
          result array
docstring_summary: Perform element-wise subtract
docstring_tokens: Perform element - wise subtract
function: def subtract(lhs, rhs):
      """ Perform element-wise subtract
  
      Parameters
      ----------
      lhs : Array or float value
          left hand side operand
  
      rhs : Array of float value
          right hand side operand
  
      Returns
      -------
      out: Array
          result array
      """
      # pylint: disable= no-member, protected-access
      if isinstance(lhs, numeric_types):
          if isinstance(rhs, numeric_types):
              return lhs - rhs
          elif isinstance(rhs, NDArray):
              return NDArray._rminus_scalar(rhs, float(lhs))
          else:
              raise TypeError('type %s not supported' % str(type(rhs)))
      elif isinstance(rhs, numeric_types):
          return NDArray._minus_scalar(lhs, float(rhs))
      elif isinstance(rhs, NDArray):
          lsize = functools.reduce(operator.mul, lhs.shape)
          rsize = functools.reduce(operator.mul, rhs.shape)
          if lsize < rsize:
              lhs = lhs.broadcast_to(rhs.shape)
          elif lsize > rsize:
              rhs = rhs.broadcast_to(lhs.shape)
          return NDArray._minus(lhs, rhs)
      else:
          raise TypeError('type %s not supported' % str(type(rhs)))
function_tokens: def subtract ( lhs , rhs ) : # pylint: disable= no-member, protected-access if isinstance ( lhs , numeric_types ) : if isinstance ( rhs , numeric_types ) : return lhs - rhs elif isinstance ( rhs , NDArray ) : return NDArray . _rminus_scalar ( rhs , float ( lhs ) ) else : raise TypeError ( 'type %s not supported' % str ( type ( rhs ) ) ) elif isinstance ( rhs , numeric_types ) : return NDArray . _minus_scalar ( lhs , float ( rhs ) ) elif isinstance ( rhs , NDArray ) : lsize = functools . reduce ( operator . mul , lhs . shape ) rsize = functools . reduce ( operator . mul , rhs . shape ) if lsize < rsize : lhs = lhs . broadcast_to ( rhs . shape ) elif lsize > rsize : rhs = rhs . broadcast_to ( lhs . shape ) return NDArray . _minus ( lhs , rhs ) else : raise TypeError ( 'type %s not supported' % str ( type ( rhs ) ) )