I have data similar to what is observed in this gist , and I'm trying to extract data using numpy. I am new to python, so I tried to do this with the following code
import numpy as np from datetime import datetime convertfunc = lambda x: datetime.strptime(x, '%H:%M:%S:.%f') col_headers = ["Mass", "Thermocouple", "T O2 Sensor",\ "Igniter", "Lamps", "O2", "Time"] data = np.genfromtxt(files[1], skip_header=22,\ names=col_headers,\ converters={"Time": convertfunc})
Where, as you can see in essence, there are 22 lines of header material. In Ipython, when I run the following code, I get an error message that ends with the following:
TypeError: float() argument must be a string or a number
A complete ipython error trace can be seen here .
I can extract six columns of numeric data just fine using the genfromtxt argument like usecols = range (0.6), but when I try to use the converter to try to tackle the last column, I'm puzzled. Any comments would be appreciated.
not link
source share