pd.__version__
'0.15.2'
I have a panda's data frame with a multiindex of three levels. When I concatenated the two dataframes, it turned the lowest index into a float where it should be a string.
I tried to replace the the .0 with nothing using
idx=str(dfmaster_stats.index.levels[2]).replace('.0', '')
and assigning it to the dataframe, but I get this error
TypeError: 'FrozenList' does not support mutable operations.
I looked at other questions and figured out that multi indexes can't be changed so I tried to reindex the dataframe. I followed this question, but both solutions do not work.
Pandas: Modify a particular level of Multiindex
It definitely does not look right. What am I doing wrong?
I also tried set_levels, but not sure of the syntax.
dfmaster_stats.index.set_levels(dfmaster_stats.index.levels[2](idx), level =2)
gives me this error
TypeError: 'Index' object is not callable