[Tutor] suggestions for splitting file based on date

Sivaram Neelakantan nsivaram.net at gmail.com
Fri Jul 19 21:24:17 CEST 2013


I've got some stock indices data that I plan to plot using matplotlib.
The data is simply date, idx_close_value and my plan is to plot the
last 30 day, 90, 180 day & all time graphs of the indices.

a) I can do the date computations using the python date libs
b) plotting with matplotlib, I can get that done

what is the best way to split the file into the last 30 day recs, 90
day recs when the data is in increasing time order?  My initial
thinking is to first reverse the file, append to various 30/90/180 day
lists for every rec > computed date for the corresponding date
windows.

Is that the way to go or is there a better way?

 sivaram
 -- 



More information about the Tutor mailing list