title: Converting CSV from two rows into columns with a timestamp
body: <p>I have a CSV file which is in the format of two rows with 24hr of data in it:
  (Comma separated. I failed to specify this in my original question, sorry!)</p>
  
  <pre><code>Site ID,Meter Reference,Date,Units,00:30,A,01:00,A,01:30,A,02:00,A,02:30,A,03:00,A,03:30,A,04:00,A,04:30,A,05:00,A,05:30,A,06:00,A,06:30,A,07:00,A,07:30,A,08:00,A,08:30,A,09:00,A,09:30,A,10:00,A,10:30,A,11:00,A,11:30,A,12:00,A,12:30,A,13:00,A,13:30,A,14:00,A,14:30,A,15:00,A,15:30,A,16:00,A,16:30,A,17:00,A,17:30,A,18:00,A,18:30,A,19:00,A,19:30,A,20:00,A,20:30,A,21:00,A,21:30,A,22:00,A,22:30,A,23:00,A,23:30,A,00:00,A
  Building,A,12/06/15,kWh,1,A,2,A,2,A,1,A,2,A,2,A,1,A,2,A,2,A,1,A,2,A,2,A,1,A,2,A,2,A,1,A,2,A,1,A,2,A,2,A,2,A,1,A,2,A,2,A,0,A,1,A,0,A,1,A,3,A,2,A,2,A,1,A,0,A,0,A,0,A,1,A,0,A,0,A,0,A,1,A,0,A,0,A,0,A,1,A,0,A,0,A,0,A,1,A
  </code></pre>
  
  <p>I need to get it into a format which I can use in another process. Which contains a full timestamp, value and Building ref. I am going to push this into a MySQL table. </p>
  
  <pre><code>Building,   Kwh,    Timestamp
  A,  2,  12/06/15 00:30
  A,  3,  12/06/15 01:00
  A,  4,  12/06/15 01:30
  A,  4,  12/06/15 02:00
  A,  2,  12/06/15 02:30
  A,  3,  12/06/15 03:00
  </code></pre>
  
  <p>I have tried to use this to pivot the data:</p>
  
  <pre><code>import csv
  
  from itertools import izip
  a = izip(*csv.reader(open("Logger.csv", "rb")))
  csv.writer(open("Long.csv", "wb")).writerows(a)
  </code></pre>
  
  <p>But this gives me headers over four rows and data over two.
  Only starting with Python today, can I modify the import csv making the conversion a bit cleaner.</p>
  
  <p>I have tried to run a second python file to append each row to add a timestamp and the remove the Row with 'A A' in it. I know this is not the right approach and looking for guidance.</p>
  
  <p>This is my current results</p>
  
  <pre><code>Site ID Building
  Meter Reference A
  Date    11/06/15
  Units   kWh
  00:30   2
  A   A
  01:00   2
  A   A
  01:30   2
  A   A
  02:00   2
  A   A
  02:30   2
  A   A
  03:00   3
  </code></pre>
  
  <p>Any help is appreciated</p>