How to split a daily DateList by week? --> Solved
- To: mathgroup at smc.vnet.net
- Subject: [mg114865] How to split a daily DateList by week? --> Solved
- From: "Sohn Hyun-U" <hsohn at student.ethz.ch>
- Date: Tue, 21 Dec 2010 00:17:06 -0500 (EST)
Hi there, I just found a better solution: Given a DateList ts, one can split it by calendar months simply using SplitBy[ts, #[[1, {1, 2}]] &] instead of my crummy first try. To split by week, I found a function ISOWeek right in this group (https://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/3dbc03f1f113b370/18e87e147589ebfe?hl=bn&lnk=gst&q=week#18e87e147589ebfe), which can then be used analogously like SplitBy[ts, #[[1, 1]] && ISOWeek[#[[1]]] &] This kind of stuff makes me love Mathematica! :-) Thanks to Hans Michel! Kind regards, Hyun-U Sohn