如何替换下面df的内部索引标签?
Question profile_gender. Gender
Values Male Female
Question Values
XCS_3. Think of a problem? NaN 25.192318 25.900784至:
Question profile_gender. Gender
Values Male Female
Question Values
XCS_3. Think of a problem? Okay Done 25.192318 25.900784我失败的尝试:
df.index = df.index.set_levels(['Okay Done'], 1)什么也不做,甚至不会抛出错误代码
发布于 2015-10-07 08:28:12
看来我必须替换整个索引,这是非常恼人的。
df.index = pd.MultiIndex.from_tuples([('XCS_3. Think of a problem?', ' Okay Done')],
names=['Question', 'Values'])https://stackoverflow.com/questions/32977092
复制相似问题