如果你有一个表格,想把行和列进行互换,这段python代码帮你实现,超简单
table = [ ('Person', 'Disks', 'Books'), ('Zoe' , 12, 24 ), ('John' , 17, 5 ), ('Julien', 3, 11 ) ] print zip(*table) #上面的代码将会返回: [ ('Person', 'Zoe', 'John', 'Julien'), ('Disks' , 12, 17, 3 ), ('Books' , 24, 5, 11 ) ]