Consecutive rows of a minimum size
Greetings all, help me with this please. I need to keep only the rows where Column 2 says “marked” at least 4 times in a row. Each group needs to be processed separately, so rows from different groups are not counted together.
| Column 1 | Column 2 | Column 3 |
| Group 0 | marked | 1.0 |
| Group 1 | marked | 2.0 |
| Group 1 | marked | 3.0 |
| Group 1 | non-marked | 4.0 |
| Group 1 | marked | 5.0 |
| Group 1 | non-marked | 6.0 |
| Group 1 | marked | 7.0 |
| Group 1 | non-marked | 8.0 |
| Group 1 | non-marked | 9.0 |
| Group 2 | non-marked | 10.0 |
| Group 2 | marked | 11.0 |
| Group 2 | non-marked | 12.0 |
| Group 2 | marked | 13.0 |
| Group 2 | non-marked | 14.0 |
| Group 2 | non-marked | 15.0 |
| Group 2 | non-marked | 16.0 |
| Group 2 | marked | 17.0 |
| Group 2 | non-marked | 18.0 |
| Group 2 | marked | 19.0 |
| Group 2 | non-marked | 20.0 |
| Group 2 | marked | 21.0 |
| Group 2 | marked | 22.0 |
| Group 2 | marked | 23.0 |
| Group 2 | marked | 24.0 |
| Group 2 | non-marked | 25.0 |I am expecting my output to be like this:
| Column 1 | Column 3 |
| Group 2 | 21.0 |
| Group 2 | 22.0 |
| Group 2 | 23.0 |
| Group 2 | 24.0 |I am hoping to get a solution that does not involve looping, but I welcome all attempts regardless.
Thank you :ok_hand: