title: IndexError: tuple index out of range with write to txt file
body: <p>I have my code</p>
  
  <pre><code>import numpy as np
  
  a1=np.empty(10)
  a1.fill(1900)
  
  a2=np.empty(10)
  a2.fill(3100)
  
  a3=np.empty(10)
  a3.fill(3600)
  
  with open('homes.txt', 'w') as f:
      for i in a1:
          for j in a2:
              for k in a3:
                 np.savetxt(f, i, j,k)
  </code></pre>
  
  <p>I want to write arrays to text file like this</p>
  
  <pre><code>1900. 3100. 3600. 
  1900. 3100. 3600. 
  1900. 3100. 3600. 
  </code></pre>
  
  <p>But terminal gives me</p>
  
  <pre><code>Traceback (most recent call last):
    File "m84.py", line 16, in &lt;module&gt;
      np.savetxt(f, i, j,k)
    File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 1034, in savetxt
      ncol = X.shape[1]
  IndexError: tuple index out of range
  </code></pre>
  
  <p>If my idea is wrong it would be nice that someone proposes other solution.</p>