title: Iterating over entire columns and storing the result into a list
body: <p>I would like to know how I could iterate through each columns of a dataframe to perform some calculations and store the result in an another dataframe.</p>
  
  <pre><code>df_empty = []
  m = daily.ix[:,-1] #Columns= stocks &amp; Rows= daily returns 
  stocks = daily.ix[:,:-1]
  for col in range (len(stocks.columns)):
      s = daily.ix[:,col]
      covmat = np.cov(s,m)
      beta = covmat[0,1]/covmat[1,1]
      return (beta)
      print(beta)
  </code></pre>
  
  <p>In the above example, I first want to calculate a covariance matrix between "s" (the columns representing stocks daily returns and for which I want to iterate through one by one) and "m" (the market daily return which is my reference column/the last column of my dataframe). Then I want to calculate the beta for each covariance pair stock/market.</p>
  
  <p>I'm not sure why return(beta) give me a single numerical result for one stock while print(beta) print the beta for all stocks.
  I'd like to find a way to create a dataframe with all these betas.</p>
  
  <pre><code>beta_df = df_empty.append(beta)
  </code></pre>
  
  <p>I have tried the above code but it returns 'none' as if it could not append the outcome.
  Thank you for your help</p>