read tsv file column

Solutions on MaxInterview for read tsv file column by the best coders in the world

showing results for - "read tsv file column"
Jacopo
24 Jan 2017
1#for example you have 4 column age,gender,name,adress 
2#if you want to gender you should give "line[1]" for arraylist
3with open("train.tsv",encoding='utf8') as tsvfile:
4    tsvreader = csv.reader(tsvfile, delimiter="\t")
5    for line in tsvreader:
6        print(line[1])