I have a data frame where one column, “Blink” indicates with 1 if blink was present during a recording and with 0 if it was not. My column “Value” stores the actual data I am using. I successfully filtered the column “Value” if “Blink” is equal to 1, thus, filtering values that happened during a blink.
I am also attempting to remove 12 values in the column “Value” before the first filtered value and 12 values after the last filtered value. Here is an example of what I am hoping for it to look like (if I wanted to filter 2 preceding and exceeding values):
I am unsure how to write a filter for the specific range before and after based on a condition from another column.