title: Why is pd.qcut() producing massive boundaries?
body: <p>I have a dataframe of event data of which a column is the interval of time in which that event occurred. I would like to use <code>pd.qcut()</code> to make the percentiles of each interval given the events that are in it, and give each event its respective percentile.</p>
  
  <pre class="lang-py prettyprint-override"><code>def event_quartiler(event_row):
      in_interval = paired_events.loc[events['TimeInterval'] == event_row['TimeInterval']]
      quartiles = pd.qcut(in_interval['DateTime'], 100)
      counter = 1
      for quartile in quartiles.unique():
          if(event_row['DateTime'] in quartile):
              return counter
          counter = counter+1
          if(counter &gt; 100): break
      return -1
  
  events['Quartile'] = events.apply(event_quartiler, axis=1)
  </code></pre>
  
  <p>I expected that this would simply set the Quartile column to each event's respective percentile, but instead the code takes forever to run and effectively blows out by outputting this:</p>
  
  <pre class="lang-py prettyprint-override"><code>ValueError: ("Bin edges must be unique: array([1.55016605e+18, 1.55016616e+18, 1.55016627e+18, 1.55016632e+18,\n       1.55016632e+18, 1.55016636e+18,
  ... (I put the ellipsis here because there are 100 data points) 
  1.55017534e+18, 1.55017545e+18,\n       1.55017555e+18]).\nYou can drop duplicate edges by setting the 'duplicates' kwarg", 'occurred at index 6539')
  </code></pre>
  
  <p>There is nothing different about the data at 6539 or any of the events in its interval, but I cannot find where I am going wrong with the code either.</p>