title: exporting a list of lists to csv in python
body: <p>I want to export a list of lists to a csv file. However, the csv file is not showing any of the data. </p>
  
  <p>Initially I have 30 rows of 'I' data and one row of 'R' data. </p>
  
  <p>I run my algorithm to obtain peak areas when R is plotted against I{i}. This gives me 30 sets of data each with three columns as follows: </p>
  
  <pre><code>&gt;      0          1             2
  &gt;     0   3053.6   105000.0  -5217775.735
  &gt;     1   3015.9    81892.0  -4013311.400
  &gt;     2   2962.8    98694.0  -2050799.050
  &gt;     3   2936.2    67884.0  -1140645.600
  &gt;     4   2906.3  2530000.0 -22099575.600
  &gt;     5   2871.5   102000.0   -653778.650
  &gt;     6   2777.9     8482.4    -68580.440
  &gt;     7   2719.3    11768.0    -91285.610
  &gt;     8   2625.0     5902.5    -40623.500
  &gt;     9   2599.3     5304.7    -69163.680
  &gt;     10  2573.5    18009.0   -170745.690
  &gt;     11  1538.0    12694.0   -965128.025
  &gt;     12  1467.7     9279.2   -144139.995
  &gt;     13  1451.4    21626.0   -280386.495
  &gt;     14  1329.8     7739.9    -63603.430
  &gt;     15  1173.9     8096.7    -66836.410
  &gt;     16   966.3    10964.0   -101197.010
  &gt;     17   799.2    32662.0   -305534.340
  &gt;     18   164.5   124000.0  -1579972.665
  </code></pre>
  
  <p><strong>Find_peaks</strong> is my function as described above. </p>
  
  <pre><code>result =[]
  
  for i in range(1,31):
      result.append(pd.DataFrame((find_peaks(df1['R'], df1['I {}'.format(i)])), index = None))
  
  for i in range(1,31):
      df2 = pd.DataFrame(result[i])
      df2.to_csv('Output.csv')
  </code></pre>
  
  <p>I'm not sure what I am doing wrong. </p>