code: def remap(input, keys, values, missing='ignore', inplace=False):
      
      input = np.asarray(input)   # FIXME: currently instances of Index are not allowed
      values = np.asarray(values)
      if missing == 'ignore':
          idx = indices(keys, input, missing='mask')
          mask = np.logical_not(idx.mask)
          idx = idx.data
      elif missing == 'raise':
          idx = indices(keys, input, missing='raise')
          mask = Ellipsis
      else:
          raise ValueError("'missing' should be either 'ignore' or 'raise'")
      output = input if inplace else input.copy()
      output[mask] = values[idx[mask]]
      return output
docs: Given an input array, remap its entries corresponding to 'keys' to 'values'
      equivalent of output = [map.get(i, default=i) for i in input],
      if map were a dictionary of corresponding keys and values
  
      Parameters
      ----------
      input : ndarray, [...]
          values to perform replacements in
      keys : ndarray, [...]
          values to perform replacements in
      values : ndarray, [...]
          values to perform replacements in
      missing : {'raise', 'ignore'}
          if `missing` is 'raise', a KeyError is raised if 'values' contains elements not present in 'keys'
          if `missing` is 'ignore', only elements of 'values' persent in 'keys' are remapped
      inplace : bool, optional
          if True, input array is remapped in place
          if false, a copy is returned
  
      Returns
      -------
      output : ndarray, [...]
          like 'input', but with elements remapped according to the mapping defined by 'keys' and 'values'