There is a data file shown as follows. Each line has four components. I would like to read whole file as an numerical array(matrix), and each line represents a slice of array.
This is what I do
f = open('/data/training.txt' ,'r')
lines = f.readlines()
for line in lines:
myarray = np.fromstring(line, dtype=float, sep=',')
print(myarray)
But the printed result are like this. What is the right way to read this ascii text file, where each entry is a float point value.
[ 0.]
[ 0.]
[ 0.]
[ 0.]
[ 0.]
[ 0.]