how to give a name to index in pandas code example
Example 1: set index to column pandas
df = df.set_index('col')
df['col'] = df.index
Example 2: pandas rename index values
df.rename(index={'alpha': 'mu'})
df = df.set_index('col')
df['col'] = df.index
df.rename(index={'alpha': 'mu'})