我的列表看起来像这样
[[x, a, d], [y], [z,f]]
它通过此
争吵#tag to print is the raw JSON
for tagElement in tagToPrint[x]:
if tagElement not in allConstrainedTagList:
if v == 0:
topicTagConcat = [tagElement]
topicTagToPrint[x] = tagElement
v = v + 1
elif v >= 1:
topicTagConcat = [topicTagConcat, tagElement]
topicTagToPrint[x] = topicTagConcat
v = v + 1
然后使用此
with open("output.csv", 'wb') as outcsv:
#configure writer to write standard csv file
writer = csv.writer(outcsv, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL, lineterminator='\n')
writer.writerow(['Topic Tag', ..... ])
while x < y:
writer.writerow(rowPrinter[x])
x = x + 1
打印出来
ID ColA ColB ColC
1 X A D
2 Y
3 Z F
我如何分析A&amp; B&amp; C一起作为一列? X,Y,Z,A,B,C是 同一列。它正在进入画面。