how to make dataframe index as column code example
Example 1: set index to column pandas
df = df.set_index('col')
df['col'] = df.index
Example 2: define a column as index pandas
myDataFrame.set_index('column_name')
df = df.set_index('col')
df['col'] = df.index
myDataFrame.set_index('column_name')