title: Pandas merge does not keep index?
body: <p>I have this two data frames:</p>
  
  <pre><code>left = pd.DataFrame({'A': ['A0', 'A1', 'A2', 'A3'],
                       'B': ['B0', 'B1', 'B2', 'B3'],
                       'key': ['K0', 'K1', 'K0', 'K1']}, 
                      index = [9,10,11,12])
  
  right = pd.DataFrame({'C': ['C0', 'C1'],
                        'key': ['K0', 'K1']})
  </code></pre>
  
  <p>When I run <code>pd.merge(left, right, on='key')</code> I get a new data frame with <em>new</em> index:</p>
  
  <pre><code>    A   B key   C
  0  A0  B0  K0  C0
  1  A2  B2  K0  C0
  2  A1  B1  K1  C1
  3  A3  B3  K1  C1
  </code></pre>
  
  <p>What I want to get is this</p>
  
  <pre><code>     A   B key   C
  9   A0  B0  K0  C0
  11  A2  B2  K0  C0
  10  A1  B1  K1  C1
  12  A3  B3  K1  C1
  </code></pre>
  
  <p>I can get it by doing <code>pd.merge(left, right, on='key', right_index = True)</code> but I have the feeling that it's more of a coincidence then feature.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>So the solution goes like this:</p>
  
  <p><code>
  left.merge(right.set_index("key"), left_on="key", right_index = True)
  </code></p>