I have a long text file that I am importing with numpy genfromtext:
00:00:01 W 348 18.2 55.9 049 1008.8 0.000
00:00:02 W 012 12.5 55.9 049 1008.8 0.000
00:00:03 W 012 12.5 55.9 049 1008.8 0.000
00:00:04 W 357 18.2 55.9 049 1008.8 0.000
00:00:05 W 357 18.2 55.9 049 1008.8 0.000
00:00:06 W 339 17.6 55.9 049 1008.8 0.000
testdata = np.genfromtxt(itertools.islice(f_in, 0, None, 60),\
names=('time','ew','d12','s12','t12','p12'.....)
time = (testdata['time'])
This is organizing all the data into an array. The first column of data in the file is a timestamp for each row. In the text file it is formatted as 00:00:00
so in format (%H:%m:%s
). However in the actual array that is generated, it turns it into 1900-01-01 00:00:00
. When plotting my data with time, I cannot get it to drop the Y-m-d.
I have tried time = time.strftime('%H:%M:%S')
and
dt.datetime.strptime(time.decode('ascii'), '%H:%M:%S')
Both do nothing. How can I turn my whole array of times to keep the original %H:%m:%s format without it adding in the %Y-%m-%d?