I have a CSV with two columns, column one is the team dedicated to a particular building in our project.
The second column is the actual building number.
Wha
This works:
import csv result={} with open('/tmp/test.csv','r') as f: red=csv.DictReader(f) for d in red: result.setdefault(d['team'],[]).append(d['bldg']) #results={'1': ['1450'], '3': ['204', '250', '1437'], '2': ['1440']}