ok, so i have a numpy array loaded from a CSV file, the array looks like :
array([['0', '3', '22', ..., '7.25', '1', '0'],
['1', '1', '38', ..., '71.2833', '0', '0'],
['1', '3', '26', ..., '7.925', '1', '0'],
...,
['0', '3', '', ..., '23.45', '1', '0'],
['1', '1', '26', ..., '30', '0', '0'],
['0', '3', '32', ..., '7.75', '0', '0']],
dtype='|S8')
I want to convert the array elements to float but i'm having this error
data2 = np.array(data).astype(np.float)
Traceback (most recent call last):
File "<input>", line 1, in <module>
ValueError: could not convert string to float:
is there a way to solve this problem with numpy or pandas ?