📜  读取 tsv 文件列 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:19.998000             🧑  作者: Mango

代码示例1
#for example you have 4 column age,gender,name,adress 
#if you want to gender you should give "line[1]" for arraylist
with open("train.tsv",encoding='utf8') as tsvfile:
    tsvreader = csv.reader(tsvfile, delimiter="\t")
    for line in tsvreader:
        print(line[1])