Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am erwindassen on github.
  • I am erwindassen (https://keybase.io/erwindassen) on keybase.
  • I have a public key ASBLbP2FxBearWGn6KJm3vk8eyoTYbo9O4PSmyH6RPCo9Qo

To claim this, I am signing this object:

@erwindassen
erwindassen / npz2json.py
Created February 5, 2018 13:13
# This snippet shows how to serialize one or more numpy arrays into a form fit for HTTP transport # namely a JSON object # Author: Erwin Dassen
# This snippet shows how to serialize one or more numpy arrays into a form fit for HTTP transport
# namely a JSON object
# Author: Erwin Dassen
from io import BytesIO
import numpy as np
import json
A = np.array([[1.+1.j, 1.j], [-1.j, 1.-1.j]], dtype=np.complex64) # dtype not necessary for np.complex128