How to divide a list into a given time step
<p>I have a list, e.g.</p>

<pre><code>event = [0.1, 0.6, 1.5, 3.4, 3.8, 4.1, 6.2, 8.5, 9.1, 9.5]  
</code></pre>

<p>Where each item in the list is a event happened at time 0.1, time 0.6 etc.</p>

<p>I want to divide the list into a delta t, but how can this be done? All the other threads I have seen only discussed about splitting the list into equal parts, but in this case if we have delta t = 1, I want a list where 0.1 and 0.6 is together, and another for 1.5 etc.</p>

<p>It look like you just want a list lists separated by the integers they are above/below. If that is the case then just use your "delta" in an conditional...loop through the list comparing each value to your delta, and keep a record of the index of your "current/active" list that you are inserting into. If the current value if less than the delta insert it.
  assuming that the initial list  is sorted...</p>

<pre><code>    import math  
    list_of_lists=[[]]
    active_index=0
    for entry in event:
      if entry&lt;delta #use current delta and an outer loop if they are preset or increment delta by your step-size on each loop
          list_of_lists[active_index].append(entry)
      else:
         list_of_lists.append([])
         active_index+=1
         list_of_lists[active_index].append(entry)
         #seems like you want to go to the next highest int here:
         delta=math.ceil[entry]
</code></pre>

python list