Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

filter dict with certain keys

>>> obj = { "a":1, "b":{"c":2,"d":3}}
>>> only(obj,["a","b.c"])
{'a': 1, 'b': {'c': 2}}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #dict #keys
ADD COMMENT
Topic
Name
2+8 =