I\'m reading lines from a file to then work with them. Each line is composed solely by float numbers.
I have pretty much everything sorted up to convert the lines in
If you want a numpy array and each row in the text file has the same number of values:
a = numpy.loadtxt('data.txt')
Without numpy:
with open('data.txt') as f:
arrays = list(csv.reader(f, delimiter=' ', quoting=csv.QUOTE_NONNUMERIC))
Or just:
with open('data.txt') as f:
arrays = [map(float, line.split()) for line in f]