rename a column by index pandas code example
Example 1: pandas rename index values
df.rename(index={'alpha': 'mu'})
Example 2: rename dataframe index column pandas
df.index.names = ['new_name']
df.rename(index={'alpha': 'mu'})
df.index.names = ['new_name']