title: Construct 1 dimensional array from several data files
body: <p>I'm trying to code a small Python script to do some data analysis. I have several data files, each one being a single column of data, I know how to import each one in python using numpy.loadtxt giving me back a ndarray. But I can't figure out how to concatenate these ndarrays, numpy.concatenate or numpy.append always giving me back error messages even if I try to flatten them first.</p>
  
  <p>Are you aware of a solution?</p>
  
  <p>Ok, as you were asking for code and data details. Here is what my data file look like:</p>
  
  <pre><code>1.4533423
  1.3709900
  1.7832323
  ...
  </code></pre>
  
  <p>Just a column of float numbers, I have no problem import a single file using:</p>
  
  <pre><code>data = numpy.loadtxt("data_filename")
  </code></pre>
  
  <p>My code trying to concatenate the arrays looks like that now (after trying numpy.concatenate and numpy.append I'm now trying numpy.insert ) :</p>
  
  <pre><code>data = numpy.zeros(0) #creating an empty first array that will be incremented by each file after
  for filename in sys.argv[1:]:
      temp = numpy.loadtxt(filename)
      numpy.insert(data, numpy.arange(len(temp), temp))
  </code></pre>
  
  <p>I'm passing the filenames when running my script with:</p>
  
  <pre><code>./my_script.py ALL_THE_DATAFILES
  </code></pre>
  
  <p>And the error message I get is:</p>
  
  <pre><code>TypeError: only length-1 arrays can be converted to Python scalars
  </code></pre>