title: pandas using qcut on series with fewer values than quantiles
body: <p>I have thousands of series (rows of a DataFrame) that I need to apply qcut on. Periodically there will be a series (row) that has fewer values than the desired quantile (say, 1 value vs 2 quantiles):</p>
  
  <pre><code>&gt;&gt;&gt; s = pd.Series([5, np.nan, np.nan])
  </code></pre>
  
  <p>When I apply <code>.quantile()</code> to it, it has no problem breaking into 2 quantiles (of the same boundary value)</p>
  
  <pre><code>&gt;&gt;&gt; s.quantile([0.5, 1])
  0.5    5.0
  1.0    5.0
  dtype: float64
  </code></pre>
  
  <p>But when I apply <code>.qcut()</code> with an integer value for number of quantiles an error is thrown:</p>
  
  <pre><code>&gt;&gt;&gt; pd.qcut(s, 2)
  ...
  ValueError: Bin edges must be unique: array([ 5.,  5.,  5.]).
  You can drop duplicate edges by setting the 'duplicates' kwarg
  </code></pre>
  
  <p>Even after I set the <code>duplicates</code> argument, it still fails:</p>
  
  <pre><code>&gt;&gt;&gt; pd.qcut(s, 2, duplicates='drop')
  ....
  IndexError: index 0 is out of bounds for axis 0 with size 0
  </code></pre>
  
  <p>How do I make this work? (And equivalently, <code>pd.qcut(s, [0, 0.5, 1], duplicates='drop')</code> also doesn't work.) </p>
  
  <p>The desired output is to have the <code>5.0</code> assigned to a single bin and the <code>NaN</code> are preserved:</p>
  
  <pre><code>0     (4.999, 5.000]
  1                NaN
  2                NaN
  </code></pre>