Dict Ops#
- apply_on_dict(dict_obj, fn, return_as_dict=False, *args, **kwargs)[source]#
Applies an operation defined by
fn
on all the entries in a dectionary.- Parameters
dict_obj (_type_) -- _description_
fn (Callable) -- method to apply on dictionary entries. The signature must be
fn(key, value, *args, **kwargs)
. where*args
and**kwargs
are forwarded fromapply_on_dict
method tofn
.return_as_dict (bool, optional) -- If True a new dictionary with modified entries is returned.
- Returns
_type_ -- _description_