我正在寻找一种pythonic 和简洁的方法来选择.csv 文件中的列并将列的所有单元格存储在例如列表中。
import csv
with open("/path/to/file.csv","r") as csvfile:
reader = csv.DictReader(csvfile, delimiter=";")
# TODO: select column for key "foo"
# TODO: select column for key "bar"
# TODO:store "foo" data in list
# TODO: store "bar" data in list