setting index column pandas code example
Example 1: set index to column pandas
df = df.set_index('col')
df['col'] = df.index
Example 2: set index in datarame
df = df.set_index('col')
df = df.set_index('col')
df['col'] = df.index
df = df.set_index('col')