I have 200k pieces of data like this (only two elements shown), imported from a CSV file
{{2015, 11, 12, "17:04", 1.0811}, {2015, 11, 12, "17:05", 1.0811}}
and want to turn it into a list suitable for DateListPlot
(I will only take small chunks once I have a plottable list], i.e. like
{{{2015, 11, 12, 17,04}, 1.0811}, {{2015, 11, 12, 17:05}, 1.0811}}
EDIT The first two lines of the CSV file are, verbatim,
Date_Time,Day,Month,Year,Date,Time,Open,Close,High,Low
12/11/2015 17:04,12,11,2015,12/11/2015,17:04,1.08110,1.08109,1.08110,1.08109
END EDIT
Having looked at Replace
, and general List manipulation instructions I realise I don't know where to begin as I am still new to Mathematica. I have looked at related questions but none has seemed appropriate since I wish to replace and restructure at the same time.
I suppose I could simply build a new table and use DateValue
to get the Hour and Minute from Part 4 of each sub list, but this seems heavy handed and I would also like to take the opportunity to learn more elegant/efficient methods of performing such list manipulations.
What would you recommend - and why?
[And - is there a way of forcing a list structure during the import so that the CVS fields for dates/time values are automatically combined into such a sublist?]
{#[[1 ;; 4]], Last[#]} & /@ list
$\endgroup$DateListPlot
that would be most illuminating $\endgroup$