I am trying to write a small script on Mathematica that graphs a particular set of data which I obtain using Python. The data output is as follows: It is a standard datetime object being echoed onto a tsv file.
2014-03-29 08:39:37.080834 04 0.403980970383 0.2
2014-03-29 08:39:39.449200 04 0.383723974228 0.2
2014-03-29 08:39:42.603058 04 0.475341081619 0.2
2014-03-29 08:39:44.882941 04 0.303984165192 0.2
2014-03-29 08:39:47.021998 04 0.312470912933 0.2
2014-03-29 08:39:48.951891 04 0.312346935272 0.2
The first column is the datetime object, time and date are separated by a space not a \t. The next 3 columns are the ones separated by a \t, but are irrelevant to the question at hand (although I'd be happy to tell what they mean if anyone is interested).
So what I am trying to do is import the first column into Mathematica so that I can graph the first and second column (i.e the date and time (x axis) with the 04s (y axis, representing events)). To do so I did this:
data = Import["/home/pi/Desktop/data.tsv"]
dates = data[[;;,1]]
DateList[dates]
But on the last line is where I get an error. I know for a fact that if I call the DateList function and I give it one of the date objects in "quotes" it works, but since for some reason these strings are not in quotes it returns an error. The error indicates that the input cannot be interpreted as a date or time input.
I've tried using something like DateList[dates//InputForm[%]], but it still does not work.
Please help me understand how strings work in Mathematica! :)
Fed