Pandas benennen den Index um
df.index = df.index.rename('new_index_name')
# Source: https://pandas.pydata.org/docs/reference/api/pandas.Index.rename.html
D Goglia
df.index = df.index.rename('new_index_name')
# Source: https://pandas.pydata.org/docs/reference/api/pandas.Index.rename.html
df.rename(index={'alpha': 'mu'})
df.rename(index={'Republic of Korea':'South Korea'},inplace=True)
# For index name:
df.index = df.index.rename('new_name')
# or
df.index.rename('new_name', inplace=True)
# For column name:
df.columns = df.columns.rename('new_name')
# or
df.columns.rename('new_name', inplace=True)