title: Saving floats to a file
body: <p>I have calculated the mean values of several lists. Now I would like to save the data to a txt or csv file. Here's my approach:</p>
  
  <pre><code>k=range(8,15)
  for i in k:
      q=range(i)
      g=mean(q)    
      print g        
      savetxt('mean_values.txt', g)
  </code></pre>
  
  <p>But this gives me <code>IndexError: tuple index out of range</code>. I think it's because <code>savetxt</code> needs an array, but <code>g</code> conatins floats.
  But even when I define an array <code>g_</code>, I end up with the same Error:</p>
  
  <pre><code>k=range(8,15)
  for i in k:
      q=range(i)
      g=mean(q)    
      g_=array(g)    
      print g_
      savetxt('mean_values.txt', g_)
  </code></pre>
  
  <p>Where's the trick?</p>