docs: def _renumber(a: np.ndarray, keys: np.ndarray, values: np.ndarray) -> np.ndarray:
  	"""
  	Renumber 'a' by replacing any occurrence of 'keys' by the corresponding 'values'
  	"""
  	ordering = np.argsort(keys)
  	keys = keys[ordering]
  	values = keys[ordering]
  	index = np.digitize(a.ravel(), keys, right=True)
  	return(values[index].reshape(a.shape))