@final
def _map_values(self, mapper, na_action=None):
    "\n        An internal function that maps values using the input\n        correspondence (which can be a dict, Series, or function).\n\n        Parameters\n        ----------\n        mapper : function, dict, or Series\n            The input correspondence object\n        na_action : {None, 'ignore'}\n            If 'ignore', propagate NA values, without passing them to the\n            mapping function\n\n        Returns\n        -------\n        Union[Index, MultiIndex], inferred\n            The output of the mapping function applied to the index.\n            If the function returns a tuple with more than one element\n            a MultiIndex will be returned.\n        "
    if is_dict_like(mapper):
        if (isinstance(mapper, dict) and hasattr(mapper, '__missing__')):
            dict_with_default = mapper
            mapper = (lambda x: dict_with_default[x])
        else:
            mapper = create_series_with_explicit_dtype(mapper, dtype_if_empty=np.float64)
    if isinstance(mapper, ABCSeries):
        if is_categorical_dtype(self.dtype):
            cat = cast('Categorical', self._values)
            return cat.map(mapper)
        values = self._values
        indexer = mapper.index.get_indexer(values)
        new_values = algorithms.take_nd(mapper._values, indexer)
        return new_values
    if (is_extension_array_dtype(self.dtype) and hasattr(self._values, 'map')):
        values = self._values
        if (na_action is not None):
            raise NotImplementedError
        map_f = (lambda values, f: values.map(f))
    else:
        values = self._values.astype(object)
        if (na_action == 'ignore'):
            map_f = (lambda values, f: lib.map_infer_mask(values, f, isna(values).view(np.uint8)))
        elif (na_action is None):
            map_f = lib.map_infer
        else:
            msg = f"na_action must either be 'ignore' or None, {na_action} was passed"
            raise ValueError(msg)
    new_values = map_f(values, mapper)
    return new_values
An internal function that maps values using the input
correspondence (which can be a dict, Series, or function).

Parameters
----------
mapper : function, dict, or Series
    The input correspondence object
na_action : {None, 'ignore'}
    If 'ignore', propagate NA values, without passing them to the
    mapping function

Returns
-------
Union[Index, MultiIndex], inferred
    The output of the mapping function applied to the index.
    If the function returns a tuple with more than one element
    a MultiIndex will be returned.
@final
def _map_values(self, mapper, na_action=None):
    "\n        An internal function that maps values using the input\n        correspondence (which can be a dict, Series, or function).\n\n        Parameters\n        ----------\n        mapper : function, dict, or Series\n            The input correspondence object\n        na_action : {None, 'ignore'}\n            If 'ignore', propagate NA values, without passing them to the\n            mapping function\n\n        Returns\n        -------\n        Union[Index, MultiIndex], inferred\n            The output of the mapping function applied to the index.\n            If the function returns a tuple with more than one element\n            a MultiIndex will be returned.\n        "
    if is_dict_like(mapper):
        if (isinstance(mapper, dict) and hasattr(mapper, '__missing__')):
            dict_with_default = mapper
            mapper = (lambda x: dict_with_default[x])
        else:
            mapper = create_series_with_explicit_dtype(mapper, dtype_if_empty=np.float64)
    if isinstance(mapper, ABCSeries):
        if is_categorical_dtype(self.dtype):
            cat = cast('Categorical', self._values)
            return cat.map(mapper)
        values = self._values
        indexer = mapper.index.get_indexer(values)
        new_values = algorithms.take_nd(mapper._values, indexer)
        return new_values
    if (is_extension_array_dtype(self.dtype) and hasattr(self._values, 'map')):
        values = self._values
        if (na_action is not None):
            raise NotImplementedError
        map_f = (lambda values, f: values.map(f))
    else:
        values = self._values.astype(object)
        if (na_action == 'ignore'):
            map_f = (lambda values, f: lib.map_infer_mask(values, f, isna(values).view(np.uint8)))
        elif (na_action is None):
            map_f = lib.map_infer
        else:
            msg = f"na_action must either be 'ignore' or None, {na_action} was passed"
            raise ValueError(msg)
    new_values = map_f(values, mapper)
    return new_values