Skip to main content

Dumps and loads numpy-arrays into or from json

Project description

TestStatus PyPiStatus BlackStyle BlackPackStyle MITLicenseBadge

Transparent dumps and loads of numpy-arrays. If a list is loaded from a json string it is given to numpy.array(). If further, the resulting array has a primitive type of either (int, float) it is returned by loads.

install

pip install json-numpy-sebastian-achim-mueller

Encoder

to dump with json.dumps().

object_hook

to load with json.loads().

example

import numpy
import json_numpy

obj = json_numpy.loads(s='{"a": [1.0, NaN]}')
assert isinstance(obj["a"], numpy.ndarray)

json_numpy.dumps(obj)
'{"a": [1.0, NaN]}'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json_numpy_sebastian_achim_mueller-0.1.9.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file json_numpy_sebastian_achim_mueller-0.1.9.tar.gz.

File metadata

File hashes

Hashes for json_numpy_sebastian_achim_mueller-0.1.9.tar.gz
Algorithm Hash digest
SHA256 81de3f4d8494d97659f6b6591377a23e450221c5d5b0e66e24e848903b2f7a85
MD5 0494add8da0454996e36b369667b5324
BLAKE2b-256 21997b3adc1ebb468b834a6e0625fc98659af3e9a56fc7f10ec0242456c94003

See more details on using hashes here.

File details

Details for the file json_numpy_sebastian_achim_mueller-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for json_numpy_sebastian_achim_mueller-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3669284fd617b8169ef07063b097188704456ced86aa075f98779c91d6863817
MD5 76fd4131a1c88a9100bb96c828bbf9a1
BLAKE2b-256 e44b0ffd60649e704b1695e31518bf1b00b11d58a33caf2ee2b5202bfb2167ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page