how to make a column in a df the new index code example Example: pandas create a column from index df.reset_index(level=0, inplace=True)