title: Pandas: changing the row indices to column indices. Or Vice versa
body: <pre><code>import pandas as pd
  df = pd.DataFrame(data={'start':[1,2,3],'zone':['a','b','c']}); 
  df['end']=[4,5,6]
  df.set_index('zone',drop=True,inplace=True,append=False)
  print(df)
  
        start  end
  zone            
  a         1    4
  b         2    5
  c         3    6
  </code></pre>
  
  <p>I would like to modify this dataframe to become:</p>
  
  <pre><code>zone  a              b            c
        start  end     start  end   start  end
        1        4     2      5     3      6
  </code></pre>
  
  <p>By changing the row indices to column indices. I need this because I want to melt the dataframe later, so it would become a long table. But I do not know how to melt the row index along with the column index. But getting this output would allow me to simply use:</p>
  
  <pre><code>pd.melt(df)
  </code></pre>
  
  <p>To get the long table.
  If there is a way to change the column indices to row indices, I could then skip the step where I change the row indices to column indices, and get the long table straight away.</p>
  
  <p>Please help.</p>