title: Pandas: vlookup type search to get average/mean values of same name/id items from multiple columns in a multi-index dataframe
body: <p>I have a data frame with names and values for items as shown below for two weeks. Some of the item names in week 1 and 2  aren't same</p>
  <pre><code>week1        week2        
  Name Value Name Value 
  a     0.1    b  0.6
  b     0.3    a  0.3
  c     0.5    d  0.1
  d     0.7    e  0.4 
  </code></pre>
  <p>What I am trying to do is create a table that has all names and average values in my final list as shown below. Also, say if item d is not in week 2 then the average should be divided by1 and not 2 something like a dynamic average</p>
  <pre><code>Name  Average_Value
  a      avg from wk1 and 2
  b      avg from wk1 and 2
  c      avg from wk1 and 2
  d          &quot;
  e          &quot;
  </code></pre>
  <p>I am thinking of using outer join to get the final table by creating two data frames for week1 and week2 values but not sure if creating two separate data frames is a good choice(doing it as not sure if join can be performed if all values are in the same data frame). What can be a better way do approach it?</p>