title: Python-Integrate then save text file
body: <p>To all: </p>
  
  <p>This question pertains to some MS research I am doing. </p>
  
  <p>What I want to do is seemingly simple. I have a text file of values( time, .....values). I then want to integrate from 0 to those values for all times, then save that value to a text file.</p>
  
  <pre><code>from numpy import *
  from pylab import *
  import os, sys, shutil
  import math
  
  #######################
  
  #Load Data
  data = loadtxt('wh.txt')
  
  #Open file to save plots to
  shutil.rmtree("wh_files")
  os.makedirs("wh_files")
  os.chdir("wh_files")
  
  for i in range(0,100,1):
     int = trapz(data[i,:],axis=0)
     print int
     savetxt('int.txt', int)
  </code></pre>
  
  <p>When I run this I get the following error: </p>
  
  <pre>
    File "integral.py", line 19, in 
      savetxt('int.txt', int)
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/lib/npyio.py", line 960, in savetxt
      ncol = X.shape[1]
  IndexError: tuple index out of range
  </pre>
  
  <p>I have been trying to solve this problem for a few days on an off now, but am yet to find a solution. I appreciate any help/comments you can give. </p>