title: Concatenate rows of data to new dataframe in Pandas
body: <p>I am working with large sets of data in Python, by way of Pandas. I have a file containing identifiers of interest and a file of data with rows that may or may not match these identifiers.</p>
  
  <p>I've written a piece of code that uses identifiers in the first file to find rows of data matching the identifier in the second file. This code presently outputs the rows of interest to the terminal (via "print"). I would like to load the rows of data my code finds into a DataFrame so that the output may be written to a csv file (via "pandas.to_csv"), but am unsure how to proceed.</p>
  
  <p>This is the code at present:</p>
  
  <pre><code>for i in range(0, len(egg.index)):
  #selects datum in file1 as search term
      identifier = egg.ix[i,0]
      for j in range(0, len(b.index)):
      #searches file2 for row indexed by identifier
          if identifier in b.ix[j, "SAMPLE_ID"]:
          print b.ix[j]
          #prints row to console
          outputdf = concat(b.ix[j])
          #should concatenate row to a fresh dataframe for output; fails
  </code></pre>
  
  <p>Thanks!</p>