| label car

问题描述 投票:0回答:1

我需要你的帮助,将我的集群从数组中保存到CSV文件中,并将其列为

我对CSV的期望是这样的

text || label
car  || vehicle
cup  || stuff

这是我的代码

import csv
row=[["TEXT","LABEL"],
     Corpus['text_final'],Corpus['tags']]
with open('text_label.csv', 'w', newline='') as file:
    writer = csv.writer(file)
    writer.writerows(row)
python csv cluster-analysis
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.