KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there a way to have a defaultdict(defaultdict(int)) in order to make the following code work? for x in stuff: d[x.a][x.b] += x.c_int d needs to be built ad-hoc, depending on x.a and x.b elements. I could use: for x in stuff: d[x.a,x.b] += x.c_int but then I wouldn't be able to use: d.keys() d[x.a].keys()
Tags (comma-separated)
Save Edits
Cancel