participants = [
    {"id": "P001", "condition": "control", "score": 88},
    {"id": "P002", "condition": "treatment", "score": 92},
    {"id": "P003", "condition": "treatment", "score": 79},
]

by_condition = {}
for p in participants:
    by_condition.setdefault(p["condition"], []).append(p["score"])

>>> by_condition
{'control': [88], 'treatment': [92, 79]}
