I have a dataframe with a list of consecutive measurements of temperature over a period of time. I would like to split these up into separate dataframes based on when the temperature is consecutively above zero. For example:
| Date | Time | Temp |
|---|---|---|
| 2022-05-20 | 4:16 | 32 |
| 2022-05-20 | 4:17 | 16 |
| 2022-05-20 | 4:18 | 0 |
| 2022-05-20 | 4:19 | 7 |
| 2022-05-20 | 4:34 | 75 |
| 2022-05-20 | 4:39 | 5 |
| 2022-05-20 | 4:48 | 0 |
| 2022-05-20 | 4:49 | 0 |
| 2022-05-20 | 4:59 | 83 |
The desired output would be:
| Date | Time | Temp |
|---|---|---|
| 2022-05-20 | 4:16 | 32 |
| 2022-05-20 | 4:17 | 16 |
and
| Date | Time | Temp |
|---|---|---|
| 2022-05-20 | 4:19 | 7 |
| 2022-05-20 | 4:34 | 75 |
| 2022-05-20 | 4:39 | 5 |
and
| Date | Time | Temp |
|---|---|---|
| 2022-05-20 | 4:59 | 83 |