title: Pandas convert columns of one dataframe to index in another dataframe
body: <p>I have some text files that are in .txt format.</p>
  
  <p>I'm trying to create a .csv file with them so that the .txt files are in the index column.</p>
  
  <p>I will add columns with demographic and statistical information (such as, L1, Prompt, and Level) later when editing the dataframe, but I want to align the txt files in the index so that I can do some NLTK analysis.</p>
  
  <p>The desired output is:</p>
  
  <pre><code>            L1         Prompt    Level    
  FileName
  data1.txt   Japanese   P1        High
  data2.txt   Korean     P1        High
  data3.txt   Chinese    P1        High
  data4.txt   Japanese   P2        Med
  data5.txt   Korean     P2        Med
  data6.txt   Chinese    P2        Med 
  data7.txt   Arabic     P1        High
  data8.txt   German     P1        High
  data9.txt   Spanish    P1        High
  data10.txt  Arabic     P2        Med
  data11.txt  German     P2        Med
  data12.txt  Spanish    P2        Med 
  </code></pre>
  
  <p>The code I tried is as follows</p>
  
  <pre><code>df1=pd.read_csv('data1.txt',names=['data1'])
  df2=pd.read_csv('data2.txt',names=['data2'])
  df3=pd.read_csv('data3',names=['data3'])
  result=pd.concat([df1,df2,df3],axis=1)
  result.to_csv('mergedfile.txt',index=False)
  </code></pre>
  
  <p>but this of course, creates columns</p>
  
  <pre><code>   data1.txt   data2.txt   data3.txt
  0  XYZ         GHI         PQR
  1  ABC         JKL         STU
  2  DEF         MNO         VWX
  </code></pre>
  
  <p>XYZ and ABC are all sentences, such as, "One of the differences between my home country and the US is convenient stores." or "One difference is public transportation, everyone took public transportation in my home country, not so much in the US."</p>
  
  <p>I have over 100,000 utterances for each txt file, so I don't want to put all of the data in the dataframe, and if i can get the txt file into the index column, that would be most ideal.</p>
  
  <p>Ultimately, I want to export this to .csv, and then use it for further analysis.</p>