最佳答案
I want to change a dataframes' index (rows) from float64 to string or unicode.
I thought this would work but apparently not:
#check type
type(df.index)
'pandas.core.index.Float64Index'
#change type to unicode
if not isinstance(df.index, unicode):
df.index = df.index.astype(unicode)
error message:
TypeError: Setting <class 'pandas.core.index.Float64Index'> dtype to anything other than float64 or object is not supported