title: Pandas: trouble understanding how merge works
body: <p>I'm doing something wrong with merge and I can't understand what it is. I've done the following to estimate a histogram of a series of integer values:</p>
  
  <pre><code>import pandas as pnd
  import numpy  as np
  
  series = pnd.Series(np.random.poisson(5, size = 100))
  tmp  = {"series" : series, "count" : np.ones(len(series))}
  hist = pnd.DataFrame(tmp).groupby("series").sum()
  freq = (hist / hist.sum()).rename(columns = {"count" : "freq"})
  </code></pre>
  
  <p>If I print <code>hist</code> and <code>freq</code> this is what I get:</p>
  
  <pre><code>&gt; print hist
          count
  series       
  0           2
  1           4
  2          13
  3          15
  4          12
  5          16
  6          18
  7           7
  8           8
  9           3
  10          1
  11          1
  
  &gt; print freq 
          freq
  series      
  0       0.02
  1       0.04
  2       0.13
  3       0.15
  4       0.12
  5       0.16
  6       0.18
  7       0.07
  8       0.08
  9       0.03
  10      0.01
  11      0.01
  </code></pre>
  
  <p>They're both indexed by <code>"series"</code> but if I try to merge:</p>
  
  <pre><code>&gt; df   = pnd.merge(freq, hist, on = "series")
  </code></pre>
  
  <p>I get a <code>KeyError: 'no item named series'</code> exception. If I omit <code>on = "series"</code> I get a <code>IndexError: list index out of range</code> exception.</p>
  
  <p>I don't get what I'm doing wrong. May be "series" is an index and not a column so I must do it differently? </p>