Hi Community,
For the below given dataset, I'd like to evaluate the "value" column by "ID" and assign a violation.
Below is the logic:
- Create a new column called "Violation"
- If ID = ST01 and value is 1 AND 4 - Label as "Violation 1"
- If ID = ST01 and value is 2 AND 7 - Label as "Violation 2"
- If ID = ST02 and value is 1 AND10 - Label as "Violation 3"
- If ID = ST02 and value is 2 AND 3 - Label as "Violation 4"
- If ID = ST02 and value is 6 AND 9 - Label as "Violation 5"
Sample and expected data attached.