nwm_region_mgr.utils.dict_utils.remove_nulls#
- nwm_region_mgr.utils.dict_utils.remove_nulls(d)[source]#
Remove nulls.
Recursively remove None values from a dictionary or list. This function traverses the input data structure and removes any keys with None values or any elements that are None in lists. It also removes empty dictionaries.
- Return type:
dict|list- Parameters:
d (dict or list) – The input data structure to clean. It can be a dictionary or a list.
- Returns:
The cleaned data structure with None values and empty dictionaries removed.
- Return type:
dict or list