Created
May 19, 2015 14:05
-
-
Save singingwolfboy/2fdc586072af86981fcd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
data = defaultdict(lambda: defaultdict(dict)) | |
# populate the data structure | |
for row in table: | |
data[row.make][row.model][row.lotnum] = color | |
# read the data structure | |
for make, models in data.items(): | |
for model, lots in models.items(): | |
for lotnum, color in lots.items(): | |
# do whatever |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment