title: How do I quantize data in pandas?
body: <p>I have a DataFrame like this </p>
  
  <pre><code>a = pd.DataFrame(a.random.random(5, 10), columns=['col1','col2','col3','col4','col5'])
  </code></pre>
  
  <p>I'd like to quantize a specific column, say <code>col4</code>, according to a set of thresholds (the corresponding output could be an integer from 0 to number of levels). Is there an API for that?</p>