title: transforming old columns to new columns in Pandas Dataframe
body: <p>I have a dataset which look like this</p>
  
  <pre><code>time channel  min    sd   mag.   frequency  
  12:00   X     12.0   2.3  x11     fx11  
  12:00   X     12.0   2.3  x12     fx12  
  12:00   X     12.0   2.3  x13     fx13  
  12:00   X     12.0   2.3  x14     fx14  
  12:00   X     12.0   2.3  x15     fx15  
  12:00   Y     17.0   2.7  y11     fy11  
  12:00   Y     17.0   2.7  y12     fy12  
  12:00   Y     17.0   2.7  y13     fy13  
  12:00   Y     17.0   2.7  y14     fy14  
  12:00   Y     17.0   2.7  y15     fy15  
  12:00   Z     15.0   4.3  z11     fz11  
  12:00   Z     15.0   4.3  z12     fz12  
  12:00   Z     15.0   4.3  z13     fz13  
  12:00   Z     15.0   4.3  z14     fz14  
  12:00   Z     15.0   4.3  z15     fz15  
  12:01   X     13.0   4.9  x21     fx21  
  ....     ...   ...   ...  ...     .....  
  ....  .....   ....  ...  ....  .....  .... 
  </code></pre>
  
  <p>As you could see that for channel X, Y, Z there are entries like 'time', 'min' and 'sd' repeating 5 times, however 'mag.' and 'frequency' are changing each time. The shape of this dataset is  (740231, 6), where this 15 rows for channel X,Y,Z keep repeating as I described above.</p>
  
  <p>I would like to get rid of this repetition and would like to transform this dataset like this:</p>
  
  <pre><code>  time channel min  sd   m1  f1    m2 f2   m3   f3   m4  f4    m5  f5    
    12:00   X    12.0 2.3  x11 fx11 x12 fx12 x13 fx13 x14  fx14  x15 fx15  
    12:00   Y    17.0 2.7  y11 fy11 y12 fy12 y13 fy13 y14  fy14  y15 fy15  
    12:00   Y    15.0 4.3  z11 fz11 z12 fz12 z13 fz13 z14  fz14  z15 fz15  
    12:01   X    13.0 4.9  x21 fx21 x22 fx22 x23 fx23 x24  fx24  x25 fx25  
    ....   ...    .....   ...  ....  ..... ....  .....  ....  .... ....  
  .... .....  ....  ....  ....  ...  ....  .....  ....  ....  ...  ...  ... 
  </code></pre>
  
  <p>which means that 15 rows x 6 columns values are now transformed in 3 rows x 14 columns.</p>
  
  <p>Any suggestions is appreciated. Many thanks for your time.</p>
  
  <p>Best Regards,
  pooja</p>