title: rearranging column data in loop
body: <p>I have a <code>data.csv</code> file it contain concatenated data as given below.
  <code>&gt;</code> are the separator of the concatenated files.</p>
  <pre><code>&gt;
  1.094   1.128   1.439
  3.064   3.227   3.371
  &gt;
  5.131   5.463   5.584
  3.65    3.947   4.135
  &gt;
  1.895   1.954   2.492
  5.307   5.589   5.839
  </code></pre>
  <p>I want to  rearrange  the column data side by side and finally wants to save to new text file as depicted below.For this demo example we can create three files.Moreover extra 0 and 5 should be appended as extra rows.</p>
  <pre><code>cat file1.txt
  1.094  5.131  1.895 0 5
  3.064  3.65   5.307 0 5
  
  cat file2.txt
  1.128  5.463  1.954 0 5
  3.227  3.947  5.589 0 5
  
  cat file3.txt
  1.439  5.584  2.492 0 5
  3.371  4.135  5.839 0 5
  </code></pre>
  <p>My trial code</p>
  <pre><code>import pandas as pd
  df = pd.read_csv('data.csv', sep='\t')
  for columns in df:
      data=df.iloc[:,columns]
  data.concat['data']
  data.to_csv('file1.txt')
  </code></pre>
  <p>error: ValueError: Location based indexing can only have [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types</p>
  <p>I am not getting the expected output.Hope experts may help me.
  Thanks.</p>