JSON encoding of numpy values for Py3K compat.