Module pandas_profiling.utils.common
Common util functions (e.g. missing in Python).
Source code
"""Common util functions (e.g. missing in Python)."""
import collections
def update(d: dict, u: dict) -> dict:
""" Recursively update a dict.
Args:
d: Dictionary to update.
u: Dictionary with values to use.
Returns:
The merged dictionary.
"""
for k, v in u.items():
if isinstance(v, collections.Mapping):
d[k] = update(d.get(k, {}), v)
else:
d[k] = v
return d
Functions
def update(d, u)
-
Recursively update a dict.
Args
d
- Dictionary to update.
u
- Dictionary with values to use.
Returns
The merged dictionary.
Source code
def update(d: dict, u: dict) -> dict: """ Recursively update a dict. Args: d: Dictionary to update. u: Dictionary with values to use. Returns: The merged dictionary. """ for k, v in u.items(): if isinstance(v, collections.Mapping): d[k] = update(d.get(k, {}), v) else: d[k] = v return d