I have a dataset that looks something like this:
| Category | Score | ID |
|---|---|---|
| A | 96 | 1 |
| A | 95 | 1 |
| A | 95 | 2 |
| A | 95 | 2 |
| B | 96 | 2 |
| B | 95 | 2 |
| B | 96 | 2 |
| C | 97 | 3 |
| C | 96 | 3 |
| C | 97 | 3 |
For each category, I want a count of the distinct IDs that have 2 scores (or more) of < 97. So, based on this data, my end goal result would be a dataframe or list that looks like:
| Category | Count |
|---|---|
| A | 2 |
| B | 1 |
| C | 0 |