title: Merge DataFrames in Pandas using the mean
body: <p>I have a set of DataFrames with numeric values and partly overlapping indices. I would like to merge them an take the mean if an index occurs in more than one DataFrame.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  df1 = pd.DataFrame([1,2,3], columns=['col'], index=['a','b','c'])
  df2 = pd.DataFrame([4,5,6], columns=['col'], index=['b','c','d'])
  </code></pre>
  
  <p>This gives me two DataFrames:</p>
  
  <pre><code>   col            col
  a    1        b     4
  b    2        c     5
  c    3        d     6
  </code></pre>
  
  <p>Now I would like to merge the DataFrames and take the mean for each index (if applicable, i.e. if it occurs more than once).</p>
  
  <p>Should look like this:</p>
  
  <pre><code>    col
  a     1
  b     3
  c     4
  d     6
  </code></pre>
  
  <p>Can I do this with some advanced merging/joining?</p>