Melt pandas with two values

29 Views Asked by At

I have a data frame with lower and upper bound values over different simulations:

Out[71]: 
       lb1     ub1     lb2     ub2    lb3  ...  lb11  ub11   lb12   ub12      target
0   0.0005  5.0005  0.0025  5.0025  0.005  ...  50.0  55.0  250.0  255.0   NOVBCNtex
1   0.0000  5.0005  0.0000  5.0025  0.000  ...   0.0  55.0    0.0  255.0    FECRMexs
2   0.0005  5.0005  0.0025  5.0025  0.005  ...  50.0  55.0  250.0  255.0     DMSOtpp
...

which I would like to reshape by long format, indexed by 'alpha' and 'target':

alpha  target      lb        ub
1      NOVBCNtex   0.0005    5.0005
2      NOVBCNtex   0.0025    5.0025
...    
11     NOVBCNtex   0.0       55.0
12     NOVBCNtex   0.0       255.0
1      FECRMexs    0.0000    5.0005    
2      FECRMexs    0.0000    5.0025
...    
11     FECRMexs    50.0      55.0
12     FECRMexs    250.0     255.0
1      DMSOtpp     0.0005    5.0005
...
0

There are 0 best solutions below