在Python中交换csv行和列(虽然我有列表,但很复杂)

在Python中交换csv行和列(虽然我有列表,但很复杂),python,csv,Python,Csv,这是我尝试创建csv文件的代码。 代码基本上可以工作,但我需要将行转换为列。 第1栏:艺术家 第二栏:相册 第三栏:歌曲标题 第4栏:歌词的URL 第五栏:歌词 第6栏:歌曲中最常见的3个词 # creates a list of all the entries that we need in the csv file # they are all lists allRows = [artist_name],albumTitleList,songTitleList,songList, \ inp

这是我尝试创建csv文件的代码。 代码基本上可以工作,但我需要将行转换为列。
第1栏:艺术家
第二栏:相册
第三栏:歌曲标题
第4栏:歌词的URL
第五栏:歌词
第6栏:歌曲中最常见的3个词

# creates a list of all the entries that we need in the csv file
# they are all lists
allRows = [artist_name],albumTitleList,songTitleList,songList, \
inputLyricsList,count

# I thought zipping will make the rows into columns, but it doesn't,
# and without it, each letter takes up a cell, instead of a word.
zipped =zip(allRows)

# write out the csv
myfile = open('test.csv', 'wb' )
wr = unicodecsv.writer(myfile, delimiter=',', lineterminator='\n')
for val in zipped:
    wr.writerows(val)
我试着用allRows代替zipped,但没有效果。
我也尝试过
zipped=zip(*allRows)
,但也没有成功

您是否可以包括csv的前5行和要测试的预期结果?您是否可以包括csv的前5行和要测试的预期结果?