I want to count the number of times an alarm occurs in the process. The data comes in every second. When an alarm occurs, the data shows 1, and if the worker doesn’t turn off the alarm, the number 1 continues to appear.
The problem is, if the alarm is not turned off within 10 seconds, it actually counts as one alarm but appears as 10 alarms in the data.
I want to leave only one row and delete the rest when the time is continuous. How can I write the script to do this?
data is here.
A column : time data 2024-06-06 13:23:30
B column : alarm data : 1 or 0