title: Python- how do I get output written into a single column of a CSV file?
body: <p>I've written a script that will calculate the reaction rates of a given atmosphere based on input from files.  That part of the script that works fine- what I'm having trouble with is output. </p>
  
  <p>The output I'm trying to write looks like this:</p>
  
  <pre><code>[4.0645563275808397e+40, 2.132787340925467e+34, 1.1095439676449723e+34, 8.8519070848594178e+30, 5.712962894343884e+29, 8.59176710723335e+25, 2.2776609537205616e+27, 1.0754560423907579e+29, 1.207315366535562e+32, 3.704635984045113e+37, 3.6601067774637497e+36, 2.9774080573246763e+41, 1.6013846123116079e+42, 68756936.415690869, 37101276694.104965, 1261680029767.3533,...]
  </code></pre>
  
  <p>There are 560 reaction rates in total. </p>
  
  <p>I've been trying to use csv.writer to write this to csv file- which it can and does do.  The problem is instead of creating one column with 560 rows to store the output, csv.writer keeps producing 560 columns with one row.  How do I get it to write the output in the format that I want? I already tried numpy.transpose, and that didn't have any effect.</p>
  
  <p>Here's the relevant code:</p>
  
  <pre><code>rate_list=[]
  for i in range (1,560): 
      A_no=int(Ar.iloc[i]) #index number for first reactant
      B_no=int(Br.iloc[i]) #index number for second reactant
      k=mydict['variable']['k'][i][29] #Grabs reaction rate constant
      A_ymix=mydict['variable']['ymix'][29][A_no] #Grabs abundance for first reactant
      B_ymix=mydict['variable']['ymix'][29][B_no] #Grabs abundance for second reactant
      rate=A_ymix*B_ymix*N*k
      rate_list.append(rate)
  with open('reaction rate list.csv','w') as output:
       writer= csv.writer(output, delimiter=',')
  writer.writerows(rate_list)
  </code></pre>
  
  <p>Any and all suggestions would be appreciated!</p>
  
  <p>Thanks!</p>