Oct-20-2021, 10:38 AM
For completeness, let's add one more solution
spam = np.array([1, 2, 3]) eggs = {'some_key':spam} print(eggs) with open('export.json', 'w') as f: json.dump(eggs, f, separators=(',', ':'), sort_keys=True, indent=4, default=lambda x: x.tolist()) ## to read it afterward with open('export.json', "r") as f: data = json.load(f) data = {key:np.array(value) for key, value in data.items()} print(data)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs