How to classify the numbers by value in DataFrame
<p>With:</p>

<pre><code>import pandas as pd     
df = pd.DataFrame({'a':[1,2,3,4,5,12,14,121,131,298,299,1001]})
print df.a.mean()
</code></pre>

<p>returns an average of all the numbers:</p>

<pre><code>157.583333333
</code></pre>

<p>Half of the numbers are smaller than 100. I wonder if there is a way to break the numbers into the categories (essentially classifying them). I would specify the number of groups to classify the numbers into and the function would return a list where each number is replaced with the corresponding category's index. So the numbers smaller then 100 would be given an integer category 1. Then the numbers from 100 - 200 would be given a category 2 and etc. Essentially some kind of rounding function that would round the numbers to that all into the range of values: from 0 to 100, from 100.1 to 200.0 and etc</p>