1 | initial version |
Your data is not really cvs, since it is not comma separated. You could configure csv
to properly parse it, but it is simpler to use native python. Here's a solution using a dictionary, instead of variables named pcb139
, etc.
sage: data = map(lambda x: x.split('\t'), open(file).readlines())
sage: vects = {col[0] : vector(map(float, col[1:])) for col in zip(*data)}
sage: vects['pcb138']
(1.46, 0.64, 3.29, 3.94, 3.18, 2.43, 3.94, 3.38, 2.21, 2.49, 0.86, 3.38, 7.39)