title: pandas how to add column of group by running range
body: <p>I have a dataframe:</p>
  <pre><code>A      B 
  0     0.1
  0.1   0.3
  0.35  0.48
  1.3   1.5
  1.5   1.9
  2.2   2.9
  3.1   3.4
  5.1   5.5
  </code></pre>
  <p>And I want to add a column that will be the rank of B after grouping in to bins of 1.5, so it will be</p>
  <pre><code>A      B     T
  0     0.1    0
  0.1   0.3    0
  0.35  0.48   0
  1.3   1.5    0
  1.5   1.9    1
  2.2   2.9    1
  3.1   3.4    2
  5.1   5.5    3
  </code></pre>
  <p>What is the best way to do so?</p>