use index as a column pandas code example
Example 1: pandas create a column from index
df.reset_index(level=0, inplace=True)
Example 2: indexing column in pandas
In [10]: type(titanic[["Age", "Sex"]])
Out[10]: pandas.core.frame.DataFrame
df.reset_index(level=0, inplace=True)
In [10]: type(titanic[["Age", "Sex"]])
Out[10]: pandas.core.frame.DataFrame