I have an arbitrarily deep set of nested dictionary:
x = {\'a\': 1, \'b\': {\'c\': 6, \'d\': 7, \'g\': {\'h\': 3, \'i\': 9}}, \'e\': {\'f\': 3}}
<
Just to expand on vaultah's answer, if one of your elements can be a list, and you'd like to handle those too:
import collections
def map_nested_dicts_modify(ob, func):
for k, v in ob.iteritems():
if isinstance(v, collections.Mapping):
map_nested_dicts_modify(v, func)
elif isinstance(v, list):
ob[k] = map(func, v)
else:
ob[k] = func(v)