title: Creating sum, mean and standard deviation for each month from time series in a dataframe
body: <p>I am trying to create a dataframe (<code>df</code>) that creates a total, mean and standard deviation of a time series by month from another dataframe called <code>performanceData</code>.  The head of performance data looks like:</p>
  
  <pre><code>             total_cost  
  date                                                                       
  2006-03-04 -1465.052092          
  2006-04-04 -1213.508277     
  2006-05-04 -1459.290503    
  2006-06-04 -1460.119361     
  2006-07-04  -772.482609
  </code></pre>
  
  <p>I have tried to use the following:</p>
  
  <pre><code>def getMonthlyPerf(performanceData):
  
      performanceData['Year']=performanceData.index.year
      performanceData['Month']=performanceData.index.month
  
      df = pd.DataFrame()
      df.columns=['new','new1','new3']
  
  
      df['Sum']=performanceData.groupby(['Year','Month'])['total_p‌​nl_po‌​s'].sum()
      df['Ave']=performanceData.groupby(['Year','Month'])['total_p‌​nl_po‌​s'].mean()
      df['Std']=performanceData.groupby(['Year','Month'])['total_p‌​nl_po‌​s'].std()
  
      return df
  </code></pre>
  
  <p>But can't get it to work; I am currently getting the error:</p>
  
  <pre><code>AttributeError: 'list' object has no attribute 'name'
  </code></pre>
  
  <p>Below is an example of the output I'm trying to create:</p>
  
  <pre><code>                  sum     ave    std
  Month   Year 
  1        2006      123    86.32  2.32
  2        2006      546    625    6.23
  3        2006      654    65     6.21
  </code></pre>