code:
dff = pd.DataFrame({'Country':['France']*4+['China']*4,
'Progress':['Develop','Middle','Operate','Start']*2,
'NumTrans':np.random.randint(100,900,8),
'TransValue':np.random.randint(10000,9999999,8)})
dff = dff.set_index(['Country','Progress']).T
Data and code are shown above.
I want to know is there any way to re-order the "Progress" as start-develop-middle-operate using Python.
I tried using map function and set each stage with a number, but cannot extract "Progress" from multi-index
Thanks!