DatetimeIndex.set_names()

pandas.DatetimeIndex.set_names

DatetimeIndex.set_names(names, level=None, inplace=False)

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 : bool

if True, mutates in place

Returns:

new index