Json encoder
NumpyEncoder
¶
Bases: JSONEncoder
numpy encoder for json
Example
import json import numpy as np obj = {'a': np.array([1, 2, 3])} json.dumps(obj, cls=NumpyEncoder) '{"a": [1, 2, 3]}'
For updates follow @Jij_Inc on Twitter
NumpyEncoder
¶ Bases: JSONEncoder
numpy encoder for json
import json import numpy as np obj = {'a': np.array([1, 2, 3])} json.dumps(obj, cls=NumpyEncoder) '{"a": [1, 2, 3]}'
minto/v1/json_encoder.py