Created
October 20, 2015 14:04
-
-
Save hakjoon/ef6b177b2b7fc6879bfd to your computer and use it in GitHub Desktop.
Filtered Dictionary without None values
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
def filtered_dict(d, keys): | |
return {key: d[key] for key in keys if d.get(key) is not None} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment