わかりました。CSV をインポートしています。次に、反復されたすべての値row[0]
を の反復された値と組み合わせたいと思いますrow[1]
。
csvfile = csv.reader(open(filename, 'rb'), delimiter=',')
for row in csvfile:
row[0] + row[1]
そのように、同じ行になくても、row[0]
のすべての値を のすべての値と結合したいことを除いて。row[1]
したがって、2 つの列があるとしましょう。1 つの列は次のとおりです。
asparagus
beets
corn
cucumbers
tomatoes
もう1つは次のとおりです。
pineapple
orange
apple
raspberry
blueberry
アスパラガスをリスト2.のすべてと組み合わせたい、つまり:
asparagus pineapple
asparagus orange
asparagus apple
asparagus raspberry
asparagus blueberry
そしてビーツ・パイナップルなどに