Given an Excel spreadsheet with 30 rows of data that looks like:
|------|------------|
| id | text |
|------|------------|
| 1 | apple |
| 2 | apple |
| 3 | banana |
| 4 | apple |
| 5 | orange |
| ... | ... |
| 30 | orange |
|------|------------|
I'm wondering if there's a way to do an integer-location based indexing. For example, if I wanted to return the first 3 rows starting from the 2nd row, I would use df.iloc[2:5]:
expected output:
|------|------------|
| 2 | apple |
| 3 | banana |
| 4 | apple |
|------|------------|
I would ultimately want to specify (1) the starting position and (2) the number of rows to return from the starting position, in Excel (e.g. return 10 rows starting from id=21). I've tried creating an array using INDEX but couldn't figure it out.


