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