Last active
August 29, 2015 14:17
-
-
Save manuphatak/e84a756614491a4d68b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import collections | |
data = {'one': 1, 'two': 2, 'three': 3, 'a': 2} | |
sorted_data = collections.OrderedDict(sorted(data.items())) | |
print sorted_data | |
print sorted_data['three'] | |
filtered_data = collections.OrderedDict( | |
filter(lambda (k, v): k is not 'three', sorted_data.items())) | |
print filtered_data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment