Index.set_names()

pandas.Index.set_names

Index.set_names(names, level=None, inplace=False) [source]

Set new names on index. Defaults to returning new index.

Parameters:

names : str or sequence

name(s) to set

level : int, level name, or sequence of int/level names (default None)

If the index is a MultiIndex (hierarchical), level(s) to set (None for all levels). Otherwise level must be None

inplace登录查看完整内容