title: pandas groupby report empty bins
body: <p>I want to make a 2d histogram (or other statistics, but let's take a histogram for the example) of a given 2d data set. The problem is that empty bins seem to be discarded altogether. For instance,</p>
  
  <pre><code>import numpy
  import pandas
  
  numpy.random.seed(35)
  values = numpy.random.random((2,10000))
  
  xbins = numpy.linspace(0, 1.2, 7)
  ybins = numpy.linspace(0, 1, 6)
  </code></pre>
  
  <p>I can easily get the desired output with</p>
  
  <pre><code>print numpy.histogram2d(values[0], values[1], (xbins,ybins))
  </code></pre>
  
  <p>giving</p>
  
  <pre><code>[[ 408.  373.  405.  411.  400.]
   [ 390.  413.  400.  414.  368.]
   [ 354.  414.  421.  400.  413.]
   [ 426.  393.  407.  416.  412.]
   [ 412.  397.  396.  356.  401.]
   [   0.    0.    0.    0.    0.]]
  </code></pre>
  
  <p>However, with pandas,</p>
  
  <pre><code>df = pandas.DataFrame({'x': values[0], 'y': values[1]})
  binned = df.groupby([pandas.cut(df['x'], xbins),
                       pandas.cut(df['y'], ybins)])
  print binned.size().unstack()
  </code></pre>
  
  <p>prints</p>
  
  <pre><code>y           (0, 0.2]  (0.2, 0.4]  (0.4, 0.6]  (0.6, 0.8]  (0.8, 1]
  x                                                                 
  (0, 0.2]         408         373         405         411       400
  (0.2, 0.4]       390         413         400         414       368
  (0.4, 0.6]       354         414         421         400       413
  (0.6, 0.8]       426         393         407         416       412
  (0.8, 1]         412         397         396         356       401
  </code></pre>
  
  <p>i.e., the last row, with <code>1 &lt; x &lt;= 1.2</code>, is missing entirely, because there are no values in it. However I would like to see that explicitly (as when using <code>numpy.histogram2d</code>). In this example I can use numpy just fine but on more complicated settings (n-dimensional binning, or calculating statistics other than counts, etc), <code>pandas</code> can be more efficient to code and to calculate than <code>numpy</code>.</p>
  
  <p>In principle I can come up with ways to check if an index is present, using something like</p>
  
  <pre><code>allkeys = [('({0}, {1}]'.format(xbins[i-1], xbins[i]),
              '({0}, {1}]'.format(ybins[j-1], ybins[j]))
             for j in xrange(1, len(ybins))
             for i in xrange(1, len(xbins))]
  </code></pre>
  
  <p>However, the problem is that the index formatting is not consistent, in the sense that, as you see above, the first index of <code>binned</code> is <code>['(0, 0.2]', '(0, 0.2]']</code> but the first entry in <code>allkeys</code> is <code>['(0.0, 0.2]', '(0.0, 0.2]']</code>, so I cannot match <code>allkeys</code> to <code>binned.viewkeys()</code>.</p>
  
  <p>Any help is much appreciated.</p>