I would like to convert the following matrix (string) to float numbers
0 0 0 0 0
0 0 0 0 78.2949219
81.0840607 83.2369537 0.000100000005 101.055199 78.5405502
i used:
import numpy as np
number = []
for line in filename:
number.append(line)
number = np.array(number)
number_float = number.astype(np.float)
but it gives me: ValueError: could not convert string to float: ' 0 0 0 0 0\n' is that because \n ?
numpy.loadtxtcould be useful?