title: Adding numbers within object
body: <p>I am trying to add the numbers that are paired with particular years, then graph the results on the same plot.</p>
  
  <p>The array is formatted this way: </p>
  
  <pre><code>[(year, [one or two nums]),(year, [one or two nums]),(year, [one or two nums]),... ]
  </code></pre>
  
  <p>Here is the code the data can be found at: <a href="https://raw2.github.com/hadley/data-baby-names/master/baby-names.csv" rel="nofollow noreferrer">https://raw2.github.com/hadley/data-baby-names/master/baby-names.csv</a></p>
  
  <pre><code>import pandas
  import pylab
  import matplotlib
  from pandas import *
  from pylab import *
  from matplotlib import *
  
  names = read_csv(r'C:\Users\joe\Documents\Python\baby-names2.csv')
  print (names.head())
  
  import matplotlib as mpl
  import matplotlib.pyplot as plt
  
  
  
  resultAry = names[names.name.isin(['Joseph', 'Nancy'])].set_index(['year','name','sex'])['prop']
  resultAry = resultAry.groupby(level='name')
  print (resultAry.head())
  print ('***************')
  resultAry = resultAry.groupby(level='year')
  print (resultAry)
  #resultAry = resultAry.plot()
  
  name
  Joseph    [(1880, [0.022209, 0.000102]), (1881, [0.02267...
  Nancy     [(1880, [0.004211]), (1881, [0.004339]), (1882...
  dtype: object
  </code></pre>
  
  <p>Ideally the array would list the the year and the sum of the two proportions that are listed with it. </p>
  
  <p>quasi code</p>
  
  <pre><code>[(year1,[prop1 + prop2(if exists)]),(year2,[prop1 + prop2(if exists)])...]
  </code></pre>
  
  <p>Out would be different in the first embedded list
      name
      Joseph    [(1880, [0.022331]), (1881, [0.02267...
      Nancy     [(1880, [0.004211]), (1881, [0.004339]), (1882...
      dtype: object</p>
  
  <p>This problem is a carry over from another post: <a href="https://stackoverflow.com/questions/21612175/plotting-in-python-with-congruent-x-values">plotting in python with congruent x-values</a></p>