For example:
INDEX FRUIT
0: "banana"
1: "apple"
2: "donut"
3: "pizza"
4: "noodles"
5: "ice-cream"
6: "grapefruit"
Usually, in order to drop rows 2-5 inclusive, I use drop.(df.index[[2,3,4,5]]) However, for the project I'm doing, the dataframe is much larger and I would have to list out all the indexes to drop a lot of rows, which is really inefficient and time-consuming. Is there a quicker and shorter way to just drop the rows using only the start and end index (in this case 2 and 5). Btw, my indexes are the default one, starting from 0, 1, 2 …
Is there a line of code or way to do that? Thanks!