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
One possible one-liner:
a_list = [map(float, line.split(' ')) for line in a_file]
Note that I used map() here instead of a nested list comprehension to aid readability.
map()
If you want a numpy array:
an_array = np.array([map(float, line.split(' ')) for line in a_file])