cufflinks.utils module¶
-
cufflinks.utils.
deep_update
(d, d_update)[source]¶ Updates the values (deep form) of a given dictionary
- d : dict
- dictionary that contains the values to update
- d_update : dict
- dictionary to be updated
-
cufflinks.utils.
dict_path
(from_d, to_d={}, l=[])[source]¶ Returns a dictionary with the path in which each of the keys is found
- Parameters:
- from_d : dict
- Dictionary that contains all the keys, values
- to_d : dict
- Dictionary to which the results will be appended
- Example:
dict_path({‘level1’:{‘level2’:{‘level3’:’value’}}}) Returns
- {‘level1’: [],
- ‘level2’: [‘level1’], ‘level3’: [‘level1’, ‘level2’]
}
-
cufflinks.utils.
inverseDict
(d)[source]¶ Returns a dictionay indexed by values {value_k:key_k} Parameters: ———–
d : dictionary
-
cufflinks.utils.
kwargs_from_keyword
(from_kwargs, to_kwargs, keyword, clean_origin=True)[source]¶ Looks for keys of the format keyword_value. And return a dictionary with {keyword:value} format
- from_kwargs : dict
- Original dictionary
- to_kwargs : dict
- Dictionary where the items will be appended
- keyword : string
- Keyword to look for in the orginal dictionary
- clean_origin : bool
- If True then the k,v pairs from the original dictionary are deleted