df
Rename index axis.
df.rename_axis("idx")
Rename columns axis.
df.rename_axis("cols", axis="columns")
Rename index and columns axes.
df.rename_axis(index="idx", columns="cols")
Change the name of a MultiIndex
.
df
df.rename_axis(['idx1','idx2'])