how to pivot data in a csv file?,"csv.writer(open('output.csv', 'wb')).writerows(a)"