I'm traing to convert lines of data into a Numpy array.
This is the first line:
['2013-08-14 00:00:00', '232598', '1.3999999761581', '', '1.1572500056095', '12.302269935608', '51.526794433594', '2.2079374790192', '0.60759371519089', '23.152534484863', '']
Then
import numpy as np
float_data = np.zeros((len(lines), len(header) - 1))
for i, line in enumerate(lines):
values = [ float(x) for x in line.split(',')[1:]]
float_data[i, :] = values
I'm getting: ValueError: could not convert string to float: I guess a string whit the value ' ' is the cause of the problem. How can I replace the ' ' with the value 0?