-
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. What I want to do is sort a dictionary of lists by value using the third item in the list. It's easy enough sort...
stackoverflow.com
위지원데이터 엔지니어로 근무 중에 있으며 데이터와 관련된 일을 모두 좋아합니다!. 특히 ETL 부분에 관심이 가장 크며 데이터를 빛이나게 가공하는 일을 좋아한답니다 ✨
'2020년 > Development' 카테고리의 다른 글
VScode에서 원격접속으로 코딩하기 (2) 2020.06.11 파이썬에서 리스트에서 원하는 값의 index를 여러개 찾는법 (2) 2020.06.10 파이썬 전역변수 사용하는 방법 (0) 2020.05.29 python을 이용해서 정규 표현식을 공부해보자(feat.python의 re 라이브러리) (0) 2020.05.26 시간 복잡도 (0) 2020.04.28