title: For loop in DataFrame
body: <p>I have multiples files with a lot of data and 19 columns. I am trying to to multiple for-loop and set it equal the first column, second etc. in the files. </p>
  
  <pre><code>import numpy as np
  import glob
  import pandas as pd
  
  #
  
  lat=np.zeros(90)
  long=np.zeros(180)
  indat=np.zeros(19)
  
  #
  
  file_in = glob.glob('filenames*.dat'). 
  for a in range(140):
     for i in range (90):
         for j in range (180):
              df = pd.DataFrame()
              for f in file_in:
                  cols = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] #there are nineteen columns 
                  indat = df.append(pd.read_csv(f, delimiter='\\s+', header=None, usecols=cols, skiprows=4), ignore_index=True)
                  lat[i]=indat[0] # error here
                  long[j]=indat[1]
                 #updates some code here
                  if i &gt;=70:
                     dens[a,j,i-70]=indat[2]
  </code></pre>
  
  <p>It gave me this error:
  <code>ValueError: setting an array element with a sequence.</code></p>
  
  <p>Updates: </p>
  
  <p><code>indat</code> has 19 columns, many files but all the format is the same.</p>
  
  <p>Sample <code>indat</code></p>
  
  <pre><code>#columns
  #0   1    2      3 ..... 19 
  -90  0   2e-12  #just some number
  -90  2   3e-12  #just some number
  -90  4   4e-12  #just some number
  ...
  -90  360 1e-12  #just some number  
  -88  0   1e-11  #just some number
  -88  2   2e-11  #just some number
  -88  4   3e-11  #just some number
  ...
  -88  360 4e-11  #just some number 
  ...
  90   0   2.5e-12  #just some number
  90   2   3.5e-11  #just some number
  90   4   4.5e-12  #just some number
  ...
  90   360 1.5e-12  #just some number 
  </code></pre>
  
  <p><strong>EDIT:</strong> I clean the code up based on everyone suggestions</p>
  
  <pre><code>import numpy as np
  import glob
  import pandas as pd
  
  file_in = glob.glob('filenames*.dat'). 
  df = pd.DataFrame()
  for f in file_in:
      cols = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
      indat = pd.read_csv(f, delimiter='\\s+', header=None, usecols=cols, skiprows=4)
  
  for a in range(140):
     for i in range (90):
         for j in range (180):
             lat[i]=indat[0] # error here
             long[j]=indat[1]
             if i &gt;=70:
                dens[a,j,i-70]=indat[2]
  
  </code></pre>