Categories
pandas pivot-table python sorting

Pandas Pivot Table manually sort columns

For a given data frame:

UUT                  testa  testb  testc  testd
DateTime
2017-11-21 18:47:29 1.0 1.0 1.0 3.0
2017-11-21 18:47:30 1.0 2.0 1.0 4.0
2017-11-21 18:47:31 1.0 2.0 5.0 2.0
2017-11-21 18:47:32 1.0 2.0 5.0 1.0
2017-11-21 18:47:33 1.0 2.0 5.0 4.0
2017-11-21 18:47:34 1.0 2.0 5.0 1.0

how can I manually rearrange the columns anyway I want it
for example if I want to the following sequence:

testc, testd, testa, testb

So the table and the plot will be in this way:

UUT                  testc  testd  testa  testb  
DateTime
2017-11-21 18:47:29 1.0 3.0 1.0 1.0
2017-11-21 18:47:30 1.0 4.0 1.0 2.0
2017-11-21 18:47:31 5.0 2.0 1.0 2.0
2017-11-21 18:47:32 5.0 1.0 1.0 2.0
2017-11-21 18:47:33 5.0 4.0 1.0 2.0
2017-11-21 18:47:34 5.0 1.0 1.0 2.0