.set_index().T code example
Example 1: pandas create a column from index
df.reset_index(level=0, inplace=True)
Example 2: set index in datarame
df = df.set_index('col')
df.reset_index(level=0, inplace=True)
df = df.set_index('col')