title: python making list of tuples into definite sized intervals
body: <p>I am having the x-value and corresponding counts in a file. I read that as list of tuples in the following form</p>
  
  <pre><code>dat = [(0.02, 1), 
  (0.0211, 1), 
  (0.021, 1), 
  (0.023, 1), 
  (0.0251, 1), 
  (0.12, 2), 
  (0.141, 1), 
  (0.14, 3), 
  (0.171, 1), 
  (0.462, 9),
  (0.467, 10),
  (0.478, 15), 
  (0.804, 20), 
  (0.815, 31), 
  (0.815, 24),
  (2.72, 164), 
  (2.78, 147), 
  (2.8, 128),
  (5.78, 6), 
  (5.83, 1), 
  (5.8603, 1),
  (5.94, 17), 
  (8.63, 3), 
  (8.87, 5),  
  (18.601, 1), 
  (19.0, 7), 
  (21.0, 2), 
  (22.0, 4)]
  </code></pre>
  
  <p>How to convert these into equal interval counts. For example, an intervals with 0.2 increments.</p>
  
  <pre><code>x    count
  0    0
  0.5  12
  1.0  75
  1.5  0
  2.0  0
  2.5  0
  3.0  439
  ... 
  </code></pre>