I am using Pandas in Python 3,
I have a dataframe whose index is like '20160727', but the datatype is 'object'.
I am trying to convert it into string type.
I tried:
data.index.astye(str, copy=False)
and data.index = data.index.map(str)
But even after these two operations,
I get:
data.index.dtype is dtype('O')
I want to use sort after converting the index to string. How can I convert the index to string datatype so that I can process it like a string?