title: pandas merge on index not working
body: <p>I have two dataframes (Series actually) generated by a groupby operation:</p>
  
  <p><code>bw</code></p>
  
  <pre><code>l1
  Consumer Discretionary         0.118718
  Consumer Staples               0.089850
  Energy                         0.109988
  Financials                     0.159418
  Health Care                    0.115060
  Industrials                    0.109078
  Information Technology         0.200392
  Materials                      0.035509
  Telecommunications Services    0.030796
  Utilities                      0.031190
  dtype: float64
  </code></pre>
  
  <p>and <code>pw</code></p>
  
  <pre><code>l1
  Consumer Discretionary         0.148655
  Consumer Staples               0.067873
  Energy                         0.063899
  Financials                     0.095689
  Health Care                    0.116015
  Industrials                    0.181346
  Information Technology         0.117715
  Materials                      0.043155
  Telecommunications Services    0.009550
  Utilities                      0.156103
  dtype: float64
  </code></pre>
  
  <p>When I try and <code>merge</code> them using</p>
  
  <p><code>pd.merge(bw,pw,left_index=True,right_index=True)</code></p>
  
  <p>I get an error</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2883, in run_code
      exec(code_obj, self.user_global_ns, self.user_ns)
    File "&lt;ipython-input-174-739bb362e06d&gt;", line 1, in &lt;module&gt;
      pd.merge(pw,attr,left_index=True,right_index=True)
    File "/usr/lib/python2.7/dist-packages/pandas/tools/merge.py", line 39, in merge
      return op.get_result()
    File "/usr/lib/python2.7/dist-packages/pandas/tools/merge.py", line 185, in get_result
      join_index, left_indexer, right_indexer = self._get_join_info()
    File "/usr/lib/python2.7/dist-packages/pandas/tools/merge.py", line 251, in _get_join_info
      left_ax = self.left._data.axes[self.axis]
  IndexError: list index out of range
  </code></pre>
  
  <p>but when I do </p>
  
  <pre><code>bw = bw.reset_index()
  pw = pw.reset_index()
  mrg = pd.merge(pw,bw,on="l1")
  </code></pre>
  
  <p>It works. It makes my code much less readable over multiple iterations of joins however so I'd like to know what I'm doing wrong and how I can get the first version of the code <code>merging on indexes</code> to work.</p>
  
  <p>Thanks</p>