title: placing numbers into bins with numpy
body: <p>I am binning an array into a set of bins using <code>np.digitize</code>:</p>
  
  <pre><code>data = np.array([1,5,6,15,25,60])
  bins = np.array([ 5, 10, 20, 50])
  result = np.digitize(data, bins)
  # this fails
  print bins[result]
  </code></pre>
  
  <p>I want the data to be placed into bins with the interpretation that each value in the bin is interpreted as "less than or equal to" except last bin, which all other values fit into. Is there a function that does this? in this case it would be: "x &lt;= 5, 5 &lt; x &lt;= 10, 10 &lt; x &lt;= 20, and 20 &lt; x &lt;= 50 including x > 50". What's the concise way to do this in numpy?</p>