Removing multiple values using if else statements?

I have a program that downloads raw data from a sensor. Due to to some specifications made in the SQL code, there are values that are duplicated which needs to be deleted to maintain data integrity.

Below is a snapshot of the dataset: enter image description here

Do note that is is just a snapshot of july 10th. I have 33 other devices all of them have data dates from july 10th all the way through october.

Is there a way for me to traverse the whole dataset and find a way to set conditional statements. For example, if there are 2 values that share the same timing, take the row that has the “1” value.

At the same time, i would like to point out that this dataset is data that is collected 24/7.