My data file is like this:
abb
sdsdfmn
sfdf sdf
2011-12-05 11:00 1.0 9.0
2011-12-05 12:00 44.9 2.0
2011-12-05 13:00 66.8 4.2
2011-12-05 14:00 22.8 1.0 26.2 45.2 2.3
2011-12-05 15:00 45.7 2.0 45.0 45.6 1.4
2011-12-05 16:00 23.2 3.0 456.2 11.7 1.5
2011-12-05 17:00 67.4 4.0 999.1 45.8 0.9
2011-12-05 18:00 34.4 1.2
2011-12-05 19:00 12.4 4.2 345.1 11.1 7.6
I used numpy genfromtxt:
data = np.genfromtxt('data.txt', usecols=(0,1,3), skip_header=4, dtype=[('date','S10'),('hour','S5'),('myfloat','f8')])
The Problem is column 3 has some empty values in there (at the beginning and later on). So it read a wrong column.
I tried the delimiter-parameter, because all float columns has fixed width (delimiter=[10,5,5]), but it also fails. Is there a workaround?