A DataFrame object can have its index reset by using the .reset_index(). A common use of this is for moving the contents of a DataFrame object's index into one or more columns.
The following code moves the symbols in the index of sp500 into a column and replaces the index with a default integer index.
A column of data can be moved to the index of a DataFrame object using the .set_index() method and by specifying the column to be moved. The following code moves the Sector column to the index.
It is possible ...