test

import numpy as np
import json

class NumpyEncoder(json.JSONEncoder):
    """ Special json encoder for numpy types """
    def default(self, obj):
        if isinstance(obj, np.integer):
            return int(obj)
        elif isinstance(obj, np.floating):
            return float(obj)
        elif isinstance(obj, np.ndarray):
            return obj.tolist()
        return json.JSONEncoder.default(self, obj)

data=np.load('prob_file.npy',encoding = "latin1", allow_pickle=True)
dumped = json.dumps(data, cls=NumpyEncoder)
#print(dumped)

path='data.json'
with open(path, 'w') as f:
    f.write(dumped)