@@ -0,0 +1,835 @@
+import json%0A%0Aimport numpy as np%0A%0A%0Aclass ShadhoEncoder(json.JSONEncoder):%0A    def default(self, obj):%0A        if isinstance(obj, np.ndarray):%0A            return %7B%0A                '__data': list(obj.ravel()),%0A                '__dtype': str(obj.dtype),%0A                '__shape': obj.shape%0A            %7D%0A        else:%0A            return super(ShadhoEncoder, self).default(obj)%0A%0A%0Aclass ShadhoDecoder(json.JSONDecoder):%0A    def __init__(self, *args, **kwargs):%0A        super(ShadhoDecoder, self).__init__(%0A            *args, object_hook=self.object_hook, **kwargs)%0A%0A    def object_hook(self, obj):%0A        if isinstance(obj, dict) and sorted(obj.keys()) == %5B'__data', '__dtype', '__shape'%5D:%0A            arr = np.array(obj%5B'__data'%5D).astype(obj%5B'__dtype'%5D).reshape(obj%5B'__shape'%5D)%0A            return arr%0A        else:%0A            return obj%0A

add JSON encoder/decoder for numpy arrays