How to convert index of a pandas dataframe into a column df = df.reset_index(level=0) df['index1'] = df.index