I have a df as this:
C CF
NO FROMNODENO TONODENO
1 1 2 582.551074 0
2 1 809.018213 0
and I would like to obtain this:
new value
NO FROMNODENO TONODENO new index
1 1 2 C 582.551074
2 1 C 809.018213
1 2 CF 0.000000
2 1 CF 0.000000
Note that there could be more columns at the beginning and some of them should not change. How to do it? And how to set the name of the new index the values of which come from the labels of the stack indices?