def JSON_NumpyArrayEncoder(obj):
if isinstance(obj, np.ndarray):<EOL><INDENT>return {'<STR_LIT>': obj.tolist(),<EOL>'<STR_LIT>': obj.dtype.__str__()}<EOL><DEDENT>elif isinstance(obj, np.generic):<EOL><INDENT>return np.asscalar(obj)<EOL><DEDENT>else:<EOL><INDENT>print(type(obj))<EOL>raise TypeError(repr(obj) + "<STR_LIT>")<EOL><DEDENT>
Define Specialize JSON encoder for numpy array