title: how to select rows from a dataframe between two lists of index?
body: <p>I'm new to python, and I'm working on a very raw dataset.</p>
  <p>lets say I have two index list x and y,</p>
  <p>x is like 1,10, 20, 25, 37
  y is like 6,15, 24, 29, 39</p>
  <p>I know how to select rows based on 1 index list, such as:</p>
  <pre><code>df.iloc[x]
  </code></pre>
  <p>but I was wondering if there is any way I could select rows between two index list?</p>
  <p>something like:</p>
  <pre><code>df.iloc[x:y]
  </code></pre>
  <p>so, from above, I can get all the rows between 1:6, 10:15</p>
  <p>Thank you so much</p>
  <p>P.S after I get all the rows between two list, there will be many dataframes I guess. So how could I loop that?</p>
  <p>so far I can think of,</p>
  <pre><code>for x, y in zip(list_1, list_2):
  pd.merge(df.iloc[x:y])
  </code></pre>
  <p>but it's wrong:(</p>