title: Creating new df columns for each iteration of "for" loop
body: <p>I am trying to calculate the diff_chg of S&amp;P sectors for 4 different dates (given in start_return) :</p>
  
  <pre><code>start_return = [-30,-91,-182,-365]
  for date in start_return:
      diff_chg = closingprices[-1].divide(closingprices[date]) 
      for i in sectors:                                  #Sectors is XLK, XLY , etc                                                          
          diff_chg[i] = diff_chg[sectordict[i]].mean()    #finds the % chg of all sectors
          diff_df = diff_chg.to_frame
  </code></pre>
  
  <p>My expected output is to have 4 columns in the df, each one with the returns of each sector for the given period (-30,-91, -182,-365.) .</p>
  
  <p>As of now when I run this code, it returns the sum of the returns of all 4 periods in the diff_df. I would like it to create a new column in the df for each period.  </p>
  
  <p>my code returns:</p>
  
  <pre><code>XLK     1.859907
  XLI     1.477272
  XLF     1.603589
  XLE     1.415377
  XLB     1.526237
  </code></pre>
  
  <p>but I want it to return:</p>
  
  <pre><code>        1mo (-30)        3mo (-61)         6mo (-182)         1yr (-365
  XLK     1.086547         values here       etc               etc
  XLI     1.0334
  XLF     1.07342
  XLE     .97829
  XLB     1.0281
  </code></pre>