I am importing numbers from a csv file that looks like the picture attached: CSV File View
However, those numbers are imported as a string and not a float so I need to convert. I've tried using this method but it just says it cannot convert.
import csv
import numpy as np
with open('20191031-0002_09.csv', mode='r') as infile:
reader = csv.reader(infile)
next(reader, None)
next(reader, None)
next(reader, None)
y = [columns[1] for columns in reader]
From research on stack I found this which I thought might work:
numbers = []
for x in y:
numbers.extend([n for n in map(float, line.split(' '))])
However, my array still comes out as a list of strings like this:
['1.09805600', '1.09805600']
Whereas, I want it to be a array of floats.
Hope you can help.