title: Binning data into equally sized bins
body: <p>I would like to bin values into equally sized bins. Let's assume that we have the following Pandas Series:</p>
  <pre><code>ex = pd.Series([1,2,3,4,5,6,7,888,999])
  </code></pre>
  <p>Now, I would like to create three bins:</p>
  <pre><code>pd.cut(ex, 3, labels=False)
  </code></pre>
  <p>This results in three bins and the following bin number assigned to each element of the series:</p>
  <pre><code>[0,0,0,0,0,0,0,2,2]
  </code></pre>
  <p>Now, I would like to have the bin borders such that each bin has equal number of elements (i.e. 3) and the assigment of the data points to the bins should look like:</p>
  <pre><code>[0,0,0,1,1,1,2,2,2]
  </code></pre>
  <p>How can I avhieve this? And what should be done for tie breaking (i.e. when the number of data points is not divisble by the number of bins)?</p>