def _set_axis_name(self, name, axis=0, inplace=False):
    '\n        Set the name(s) of the axis.\n\n        Parameters\n        ----------\n        name : str or list of str\n            Name(s) to set.\n        axis : {0 or \'index\', 1 or \'columns\'}, default 0\n            The axis to set the label. The value 0 or \'index\' specifies index,\n            and the value 1 or \'columns\' specifies columns.\n        inplace : bool, default False\n            If `True`, do operation inplace and return None.\n\n            .. versionadded:: 0.21.0\n\n        Returns\n        -------\n        Series, DataFrame, or None\n            The same type as the caller or `None` if `inplace` is `True`.\n\n        See Also\n        --------\n        DataFrame.rename : Alter the axis labels of :class:`DataFrame`.\n        Series.rename : Alter the index labels or set the index name\n            of :class:`Series`.\n        Index.rename : Set the name of :class:`Index` or :class:`MultiIndex`.\n\n        Examples\n        --------\n        >>> df = pd.DataFrame({"num_legs": [4, 4, 2]},\n        ...                   ["dog", "cat", "monkey"])\n        >>> df\n                num_legs\n        dog            4\n        cat            4\n        monkey         2\n        >>> df._set_axis_name("animal")\n                num_legs\n        animal\n        dog            4\n        cat            4\n        monkey         2\n        >>> df.index = pd.MultiIndex.from_product(\n        ...                [["mammal"], [\'dog\', \'cat\', \'monkey\']])\n        >>> df._set_axis_name(["type", "name"])\n                       legs\n        type   name\n        mammal dog        4\n               cat        4\n               monkey     2\n        '
    axis = self._get_axis_number(axis)
    idx = self._get_axis(axis).set_names(name)
    inplace = validate_bool_kwarg(inplace, 'inplace')
    renamed = (self if inplace else self.copy())
    renamed.set_axis(idx, axis=axis, inplace=True)
    if (not inplace):
        return renamed
Set the name(s) of the axis.

Parameters
----------
name : str or list of str
    Name(s) to set.
axis : {0 or 'index', 1 or 'columns'}, default 0
    The axis to set the label. The value 0 or 'index' specifies index,
    and the value 1 or 'columns' specifies columns.
inplace : bool, default False
    If `True`, do operation inplace and return None.

    .. versionadded:: 0.21.0

Returns
-------
Series, DataFrame, or None
    The same type as the caller or `None` if `inplace` is `True`.

See Also
--------
DataFrame.rename : Alter the axis labels of :class:`DataFrame`.
Series.rename : Alter the index labels or set the index name
    of :class:`Series`.
Index.rename : Set the name of :class:`Index` or :class:`MultiIndex`.

Examples
--------
>>> df = pd.DataFrame({"num_legs": [4, 4, 2]},
...                   ["dog", "cat", "monkey"])
>>> df
        num_legs
dog            4
cat            4
monkey         2
>>> df._set_axis_name("animal")
        num_legs
animal
dog            4
cat            4
monkey         2
>>> df.index = pd.MultiIndex.from_product(
...                [["mammal"], ['dog', 'cat', 'monkey']])
>>> df._set_axis_name(["type", "name"])
               legs
type   name
mammal dog        4
       cat        4
       monkey     2
def _set_axis_name(self, name, axis=0, inplace=False):
    '\n        Set the name(s) of the axis.\n\n        Parameters\n        ----------\n        name : str or list of str\n            Name(s) to set.\n        axis : {0 or \'index\', 1 or \'columns\'}, default 0\n            The axis to set the label. The value 0 or \'index\' specifies index,\n            and the value 1 or \'columns\' specifies columns.\n        inplace : bool, default False\n            If `True`, do operation inplace and return None.\n\n            .. versionadded:: 0.21.0\n\n        Returns\n        -------\n        Series, DataFrame, or None\n            The same type as the caller or `None` if `inplace` is `True`.\n\n        See Also\n        --------\n        DataFrame.rename : Alter the axis labels of :class:`DataFrame`.\n        Series.rename : Alter the index labels or set the index name\n            of :class:`Series`.\n        Index.rename : Set the name of :class:`Index` or :class:`MultiIndex`.\n\n        Examples\n        --------\n        >>> df = pd.DataFrame({"num_legs": [4, 4, 2]},\n        ...                   ["dog", "cat", "monkey"])\n        >>> df\n                num_legs\n        dog            4\n        cat            4\n        monkey         2\n        >>> df._set_axis_name("animal")\n                num_legs\n        animal\n        dog            4\n        cat            4\n        monkey         2\n        >>> df.index = pd.MultiIndex.from_product(\n        ...                [["mammal"], [\'dog\', \'cat\', \'monkey\']])\n        >>> df._set_axis_name(["type", "name"])\n                       legs\n        type   name\n        mammal dog        4\n               cat        4\n               monkey     2\n        '
    axis = self._get_axis_number(axis)
    idx = self._get_axis(axis).set_names(name)
    inplace = validate_bool_kwarg(inplace, 'inplace')
    renamed = (self if inplace else self.copy())
    renamed.set_axis(idx, axis=axis, inplace=True)
    if (not inplace):
        return renamed