to show index as column in python dataframe code example
Example 1: pandas convert index to column
df.reset_index(inplace=True)
Example 2: indexing column in pandas
In [10]: type(titanic[["Age", "Sex"]])
Out[10]: pandas.core.frame.DataFrame
df.reset_index(inplace=True)
In [10]: type(titanic[["Age", "Sex"]])
Out[10]: pandas.core.frame.DataFrame