I have a dataframe with two columns: trialType and diameter. I need to find everywhere where trialType == 'start', and then get the diameter for all 2500 rows before and after those locations, inclusive. I tried the following:
idx = df.loc(df[df['trialType']=='start'])
df.iloc[idx - 2500 : idx + 2500]
My goal is to have a dataframe with only those relevant rows (2500 rows in between each 'start' trial). Below is an example just with much fewer rows:
trialType diameter
start 3.15
3.17
3.18
start 3.14
3.13
3.13