environmentaltools.common.keys_as_nparray

environmentaltools.common.keys_as_nparray(obj: dict)[source]

Convert the values at reading json file into numpy arrays recursively.

Recursively processes nested dictionaries up to 3 levels deep, converting values to numpy arrays where possible.

Parameters:

obj (dict) – Input dictionary with nested structure.

Returns:

Dictionary with values converted to numpy arrays where applicable.

Return type:

dict