title: How to find the same index between two dataframes and combine it to a new dataframe, Python 3
body: <p>I have two pandas.dataframes <code>df1</code> and <code>df2</code>. Some of their index are equal. I want to find those index and combine the corresponding rows into a new dataframe.</p>
  
  <pre><code>df1 =
          A    B
  Name
  apple   1    5
  orange  2    6
  banana  3    7
  
  
  df2 =
          A    B
  Name
  apple  -1   10
  audi   -2   11
  bmw     0   12
  banana  2    8
  vw     -3    6
  </code></pre>
  
  <p>The new dataframe that I want is: 1) find the rows with the same index; 2) calculate the average value of the corresponding rows in column 'A'.</p>
  
  <pre><code>df_new = 
          A_average   
  Name
  apple   0   
  banana  2.5
  </code></pre>
  
  <p>This is because: <code>df1</code> and <code>df2</code> both have the index <code>apple</code> and <code>banana</code>. The average value of <code>apple</code> in column 'A' is <code>(1-1)/2=0</code>, and the average value of <code>banana</code> in column 'A' is <code>(3+2)/2=2.5</code>.</p>
  
  <p>Do you know how to use Python3 to achieve this? Please note that, in my real application, there can be many more rows than the example I showed above.</p>
  
  <p>Thanks!</p>