title: Weighting results in pandas crosstab
body: <p>I would like to use a third column to weight results in a pandas crosstab.</p>
  
  <p>For example, the following:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar', 'bar'],
                     'B': [1, 1, 0, 0, 0],
                     'weight': [2, 3, 4, 5, 6]})
  print(pd.crosstab(df.A, df.B))
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>B    0  1
  A        
  bar  2  1
  foo  1  1
  </code></pre>
  
  <p>What I would like as a result is:</p>
  
  <pre><code>B     0  1
  A        
  bar  11  3
  foo   4  2
  </code></pre>