title: Python - split list in to sublists based on another list
body: <p>I have two lists: <code>l1 = [0, 0.002, 0.3, 0.5, 0.6, 0.9, 1.3, 1.9]</code> 
  and <code>l2 = [0.5, 1.0, 1.5, 2.0]</code>. I want to split <code>l1</code> in to sublists that are defined as the elements between two indexes of <code>l2</code>. So for example <code>l1</code> would be equal to <code>[[0,0.002, 0.3], [0.5, 0.6, 0.9], [1.3], [1.9]]</code>.</p>
  
  <p>Here is my solution:</p>
  
  <pre><code>l3 = []
  b=0
  for i in l2:
      temp = []
      for p in l1:
          if b &lt;= p &lt; i:
          temp.append(p)
      l3.append(temp)
      b+=0.5
  </code></pre>
  
  <p>This solution is a huge bottleneck in my code. Is there a faster way to do this?</p>