2020년/Development
list value를 가진 dictionary 정렬
myDict = { 'item1' : [ 7, 1, 9], 'item2' : [8, 2, 3], 'item3' : [ 9, 3, 11 ] } >>> sorted(myDict.items(), key=lambda e: e[1][2]) [('item2', [8, 2, 3]), ('item1', [7, 1, 9]), ('item3', [9, 3, 11])] https://stackoverflow.com/questions/1217251/python-sorting-a-dictionary-of-lists Python: sorting a dictionary of lists Still learning python (finally!) and can't quite wrap my head around this one yet...
2020. 6. 3. 17:00