title: Python Pandas Pivot Table Calculations
body: <p>I am trying to figure out how to calculate the mean values for each row in this Python Pandas Pivot table that I have created. </p>
  
  <p>I also want to add the sum of each year at the bottom of the pivot table.</p>
  
  <p>The last step I want to do is to take the average value for each month calculated above and divide it with the total average in order to get the average distribution per year. </p>
  
  <pre><code>import pandas as pd 
  import pandas_datareader.data as web
  import datetime
  
  start = datetime.datetime(2011, 1, 1)
  end = datetime.datetime(2017, 12, 31)
  
  libor = web.DataReader('USD1MTD156N', 'fred', start, end) # Reading the data
  libor = libor.dropna(axis=0, how= 'any') # Dropping the NAN values
  libor = libor.resample('M').mean() # Calculating the mean value per date
  libor['Month'] = pd.DatetimeIndex(libor.index).month # Adding month value after each 
  libor['Year'] = pd.DatetimeIndex(libor.index).year # Adding month value after each 
  
  pivot = libor.pivot(index='Month',columns='Year',values='USD1MTD156N')
  print pivot
  </code></pre>
  
  <p>Any suggestions how to proceed? 
  Thank you in advance</p>