Is it possible to read csv files in columns instead of rows in python?
csv
e.g. if i have a csv file like this:
a b c 1 0 1 1 4 1
How woul
use zip(*reader).
zip(*reader)
some.csv
scrip.py
import csv with open('some.csv', 'rb') as f: reader = csv.reader(f, delimiter=' ') print zip(*reader)
output:
[('a', '1', '1'), ('b', '0', '4'), ('c', '1', '1')]