title: Selecting all the rows between 2 specific rows in Pandas data frame
body: <p>I have 2 data frames, first one with 5 columns that defines the search criteria and second with 2 columns which is the data that's searched.</p>
  
  <p>I need to write all the rows between 2 rows that match a certain criteria from the second data frame to a new data frame.</p>
  
  <p>There are thousands of such cases (one per each row from first data frame) to be written.</p>
  
  <p>Can I use any() or isin() here so that I could retireve the index of the 2 rows that match the criteria and loop in between to write the target rows to a new data frame one by one? </p>
  
  <p>This question is related to my previous question which was never answered. 
  (<a href="https://stackoverflow.com/questions/24162379/searching-for-both-ends-of-range-from-pandas-data-frame-in-another-data-frame-an">Searching for both ends of range from pandas data frame in another data frame and expanding it to a new data frame</a>)
  I've figured out a little bit of the solution for it and am posting this question to move forward.</p>