Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Eliminating string after reading

Suppose I have a file called data.cvs which is

3;2
2;1
1;0.1
0.01;-0.9

I can read it by

import csv
data=list( csv.reader(open('data3.csv','r')) )

but for SM it will had the structure af a matrix of string

[['3;2'], ['2;1'], ['1;0.1'], ['0.01;-0.9']]

How could I eliminate the quotes and replace ; by , ? In passing import is not a word in the documentation .