티스토리 뷰

공부

[Python] Filter dict

승가비 2020. 1. 18. 18:15
728x90
{5:"djdj", 6:"8899", 7:"998kdj"}
[v for k,v in mydict.items() if k >= 6]

 

[출처] https://stackoverflow.com/questions/4181367/how-to-to-filter-dict-to-select-only-keys-greater-than-a-value

728x90

'공부' 카테고리의 다른 글

[Spring] @Async & @AOP  (0) 2020.01.18
[HDFS] Export & Import  (0) 2020.01.18
[SQL] `!=` Doesn't include NULL  (0) 2020.01.18
[Hive] Alter Table Column Type  (0) 2020.01.18
[Linux] Encoding 깨질때  (0) 2020.01.18
댓글