KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to sort OrderedDict in OrderedDict by 'depth' key. Is there any solution to sort that Dictionary ? OrderedDict([ (2, OrderedDict([ ('depth', 0), ('height', 51), ('width', 51), ('id', 100) ])), (1, OrderedDict([ ('depth', 2), ('height', 51), ('width', 51), ('id', 55) ])), (0, OrderedDict([ ('depth', 1), ('height', 51), ('width', 51), ('id', 48) ])), ]) Sorted dict should look like this: OrderedDict([ (2, OrderedDict([ ('depth', 0), ('height', 51), ('width', 51), ('id', 100) ])), (0, OrderedDict([ ('depth', 1), ('height', 51), ('width', 51), ('id', 48) ])), (1, OrderedDict([ ('depth', 2), ('height', 51), ('width', 51), ('id', 55) ])), ]) Any idea how to get it?
Tags (comma-separated)
Save Edits
Cancel