How can I mark as 'abuser' across rows of same ID if one of rows of that ID satisfy a condition?
For example, if I have the following table,
| ID | social score |
|---|---|
| 1 | 0 |
| 1 | 2 |
| 1 | 3 |
| 2 | 3 |
| 2 | 1 |
| 2 | 2 |
Can I mark rows of ID 1 as all abnormal (because social score of one of rows is 0 ) and mark rows of ID 2 as all normal (because social score of none of rows of ID 2 is 0 )?
| ID | social score | class |
|---|---|---|
| 1 | 0 | 'abnormal' |
| 1 | 2 | 'abnormal' |
| 1 | 3 | 'abnormal' |
| 2 | 3 | 'normal' |
| 2 | 1 | 'normal' |
| 2 | 2 | 'normal' |
If I can, with what python phrase?