title: Grouping value by time frames
body: <p>Here is what I am using to group items by time frame when parsing a csv file, it is working fine, but now I would like to create slices by 4h and 30mn, this particular code just works for slices by the hour, I would like to create 4 hours slices ( or 30m slices )</p>
  
  <pre><code>tf = "%d-%b-%Y-%H"
  
  lmb = lambda d: datetime.datetime.strptime(d["Date[G]"]+"-"+d["Time[G]"], "%d-%b-%Y-%H:%M:%S.%f").strftime(tf)
  
  for k, g in itertools.groupby(csvReader, key = lmb):
      for i in g:
          "do something"
  </code></pre>
  
  <p>Thanks!</p>